Unconfigured Ad Widget

Collapse

Basic web design question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • berg
    Senior Member
    • Oct 2005
    • 1963

    Basic web design question

    Edit:

    Is there a way to edit the code on your web page so that it automatically applies to all your pages? If I have 20 pages on my web site and I want to change some links in my navigation menu, I don't want to have to edit all 20 pages.

    Would a program like MS Word, Notepad++, Dreamweaver, or something else allow me to do this?

    __________________________________________________ ________________________________________________

    I want to create a site that has about 20 pages. Is there a code type (css, xhtml,php, etc) that would allow me to make a change on one page and it would automatically affect all the other pages?

    I'm specifically thinking about the navigation menu. If I add more pages I don't want to have to go into the code on each page and add the new link to the new page.

    I looked at css but it seems to mostly be about being able to change content and colors instead of navigation links.
    Last edited by berg; 03-16-2012, 4:00 PM. Reason: added details and clarity (hopefully)
    __________________________________________________ _____________________________________
    The whole problem with the world is that fools and fanatics are always so sure of themselves, and wiser people are full of doubts. - Bertrand Russell
  • #2
    Andric
    Member
    • Oct 2010
    • 216

    you can do that with css as well, just think of your nav menu as content on the page.

    Comment

    • #3
      berg
      Senior Member
      • Oct 2005
      • 1963

      Thanks for the reply. Any chance you could show me an example of this?

      Whenever I look at a .css file for someone's web site the navigation coding is not there. I've only ever seen the navigation links coding within the .html file.

      For example on this site: http://www.alistapart.com/

      The source for their css code http://www.alistapart.com/css/facelift-master.css

      Compare that to their html code when you view source.
      __________________________________________________ _____________________________________
      The whole problem with the world is that fools and fanatics are always so sure of themselves, and wiser people are full of doubts. - Bertrand Russell

      Comment

      • #4
        ocabj
        Calguns Addict
        • Oct 2005
        • 7924

        css is meant to give you better control over the appearance of page elements.

        If you want dynamic content (e.g. menu items available based on pages available in a web dir), then you would just use another language to generate the html on the fly (e.g. PHP, Ruby on Rails, Perl, etc).

        You're going to use css in combination with other programming languages like php.

        Distinguished Rifleman #1924
        NRA Certified Instructor (Rifle and Metallic Cartridge Reloading) and RSO
        NRL22 Match Director at WEGC

        https://www.ocabj.net

        Comment

        • #5
          wildhawker
          I need a LIFE!!
          • Nov 2008
          • 14150

          Originally posted by berg
          I want to create a site that has about 20 pages. Is there a code type (css, xhtml,php, etc) that would allow me to make a change on one page and it would automatically affect all the other pages?

          I'm specifically thinking about the navigation menu. If I add more pages I don't want to have to go into the code on each page and add the new link to the new page.

          I looked at css but it seems to mostly be about being able to change content and colors instead of navigation links.
          Why not use an open source CMS e.g. WordPress, Drupal, or Joomla?

          -Brandon
          Brandon Combs

          I do not read private messages, and my inbox is usually full. If you need to reach me, please email me instead.

          My comments are not the official position or a statement of any organization unless stated otherwise. My comments are not legal advice; if you want or need legal advice, hire a lawyer.

          Comment

          • #6
            ldivinag
            In Memoriam
            • Oct 2005
            • 4858

            i would agree with brandon on the CMS path.

            they allow you to add stuff on the fly while keeping look and feel constant.

            if you wanna roll your own, back when i took programming in high school back in the early 80s, we used a book titled DATA STRUCTURES + ALGORITHMS = PROGRAMS.

            these days, i think the future of web pages is HTML + CSS = WEB PAGES.

            a web DESIGNER will do the layout, look and feel, color, etc. this is CSS

            a web DEVELOPER will the HTML part (either static or dynamic).
            leo d.

            Comment

            • #7
              Autarchist
              Member
              • Feb 2012
              • 188

              +1 for the Wordpress route. It's easy to install and modify to your liking.

              Comment

              • #8
                bpetro
                Junior Member
                • Mar 2009
                • 42

                Honestly there isn't enough info in this thread to make a solid recommendation regarding the platform that you should build your site on. If you want to give me a ring I'd be happy to consult with you and give you some free advice.

                Thanks!
                Brian Petro
                NRA lifetime member
                707-585-2088
                calguns@bpwebdesign.com
                www.bpwebdesign.com

                Comment

                • #9
                  berg
                  Senior Member
                  • Oct 2005
                  • 1963

                  Thanks for all the replies. It's clear I'm not asking my question right. I edited my original post with the following:

                  Is there a way to edit the code on your page so that it automatically applies to all your pages? If I have 20 pages on my web site and I want to change some links in my navigation menu, I don't want to have to edit all 20 pages.

                  Would a program like MS Word, Notepad++, Dreamweaver, or something else allow me to do this?
                  __________________________________________________ _____________________________________
                  The whole problem with the world is that fools and fanatics are always so sure of themselves, and wiser people are full of doubts. - Bertrand Russell

                  Comment

                  • #10
                    Autarchist
                    Member
                    • Feb 2012
                    • 188

                    Originally posted by berg
                    Thanks for all the replies. It's clear I'm not asking my question right. I edited my original post with the following:

                    Is there a way to edit the code on your page so that it automatically applies to all your pages? If I have 20 pages on my web site and I want to change some links in my navigation menu, I don't want to have to edit all 20 pages.

                    Would a program like MS Word, Notepad++, Dreamweaver, or something else allow me to do this?
                    What you are talking about is called "dynamic content".

                    It's not about the software you use (Dreamweaver, Notepad, whatever), that would be like asking which brand of hammer you need to build a house. You'll need to use a web technology that will allow for dynamic content, like PHP.

                    Using PHP would be easy. You'd just need to take the code for your navigation section and put it in a separate file like navigation.html. Then, on all your pages, you'd just need to stick this piece of code (assuming all the files are in the same directory) wherever you want the navigation bar to appear in page like this:
                    Code:
                    <?php include('navigation.html'); ?>
                    When the page is rendered, the content from navigation.html will automatically be inserted wherever that PHP code is. This is a sloppy/noobish way to do it, but from that point on any changes you make to navigation.html will automatically be rendered in all the pages with that piece of code.

                    Of course, the pages would need to have .php extensions rather than .html, and you would need to access them through an Apache server, locally or remotely.

                    All that said, you would likely save yourself a lot of time and effort by just going with a Wordpress installation - especially if all you want is a dynamic navigation bar. It's free and takes just a few minutes to install on your web server. In fact, if you already have a hosting account, there is probably an auto-installer feature on there.

                    EDIT: If you want to make a one time change, you might be able to do that with Dreamweaver or any other software that can run Find and Replace for multiple files.
                    Last edited by Autarchist; 03-16-2012, 5:29 PM.

                    Comment

                    • #11
                      speedrrracer
                      Veteran Member
                      • Dec 2011
                      • 3355

                      Loving it -- the principles of good software design are so self-evident, even a total n00b can see them and is trying to reach out and make them happen.

                      Kudos to the OP.

                      Now if I could just get the CEO of my company to be half as intelligent...

                      Anyways, to the OP, what you want is a bit beyond your skill level. As Autarchist showed, it's a problem that's been solved, but takes a bit more savvy.

                      I'd recommend either stepping up your skills, and learning more about web development (with Java, or Javascript, or php, or Ruby on Rails, or any one of a zillion options) or learning a bit about Autarchist's other recommendation, and look into find and replace over multiple files. There are many tools for that.

                      Comment

                      • #12
                        Rivers
                        Senior Member
                        • Feb 2007
                        • 1630

                        Originally posted by berg
                        Thanks for all the replies. It's clear I'm not asking my question right. I edited my original post with the following:

                        Is there a way to edit the code on your page so that it automatically applies to all your pages? If I have 20 pages on my web site and I want to change some links in my navigation menu, I don't want to have to edit all 20 pages.

                        Would a program like MS Word, Notepad++, Dreamweaver, or something else allow me to do this?
                        With a Mac, I would use something like BBEdit and the GREP (global replace) to replace any string of text across a whole folder or site. Find something similar for Win.

                        In the future, using "includes" instead of putting all of the links onto each page. You'd just "include" the include file, then editing the include file applies wherever it's been used.
                        NRA Certified Instructor: Basic Pistol Shooting

                        Comment

                        • #13
                          Bryansix
                          Calguns Addict
                          • Feb 2011
                          • 5311

                          Actually, if you are editing a static webpage (meaning there is no database) then Dreamweaver has this concept of master templates which do exactly what you want. You edit the master template and it updates all the files which rely on it. You make every page based on the master.

                          The problem is every time you edit the master, you have to upload the whole stinkin' website again. This is very time consuming and things can go wrong very easily.

                          So, you CAN do it but that method of website design is at least 10 years out of date. I run my website on wordpress and my wife did an even simpler route and went with Blogger. Both use databases in the backend so changes get made in one place only.
                          My Guns:
                          SP 2022 9mm - 2575 rounds
                          Hi-Point Carbine 9mm | Bushnell TRS-25 Red Dot |Magpul BUIS 45 degree offset - 140 rounds
                          "Reloading is kind of like crocheting for the gun enthusiast with the one exception that while you can have too many drink coasters and ski hats, you cannot have too much ammo." ~Bryansix

                          Comment

                          Working...
                          UA-8071174-1