www.webdeveloper.com
Results 1 to 9 of 9

Thread: Simple Question...

  1. #1
    Join Date
    Dec 2004
    Posts
    11

    Question Simple Question...

    Hi all,

    I have a question that should be really easy to answer, but I don't have the experience or exposure necessary, so I was hoping someone on this board could help me out.

    I made a few personal "hobby" websites, so I am familiar with HTML. I am NOT a programmer or web developer by any means, however... so if you have an answer, pretend you're giving advice to a six year old.

    My latest website is going to analyze many different gadgets and gizmos... so I want to make a template for the pages, and be able to easily create new pages. The problem is that the links inside the template will need to change often. So, the top of the pages is a menubar... one of the types that are like:

    [ Home ] | [ Links ] | [ Page 1 ] | [ Page 2 ]

    How should I make the template so that I can update that heading on all 50 or 100 webpages just by changing some code at a single source?

    Is there a certain type of programming I should use? I'm not familiar with all types, and I'm not a real computer whiz, so easier is better.

    THANKS IN ADVANCE!!

    -BobDonut

  2. #2
    Join Date
    Jul 2003
    Location
    Los Angeles California
    Posts
    1,045
    no unslees you had the files included. but if you just have html on 100 differnt fiels then you cant

  3. #3
    Join Date
    Dec 2004
    Posts
    11

    ...

    Right, I know I can't do that with just HTML... my question is how do I do it using something else (something easy to learn), and what should I use? I haven't yet done the pages... I'm trying to do some planning in advance. Thanks.

    -BobDonut

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    The easiest way is server side includes (SSI).

  5. #5
    Join Date
    Dec 2004
    Posts
    11
    I just did a little research, and it came up that SSI might be better suited for "small amounts of data, such as the current time." I'm going to have about 20 - 30 links changing, possibly daily. In light of that, would CGI be better?

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,357
    It's pretty easy to do with some sort of CGI program. I do it in PHP on my site. I have an include file that defines functions for generating the top and bottom of each page. Then on each content page I just need a few lines of code (like 3) to include the function file and call the two functions. Then if I want to change anything in the header or footer sections of my pages, all I have to do is change it once in the include file.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  7. #7
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Originally posted by BobDonut
    I just did a little research, and it came up that SSI might be better suited for "small amounts of data, such as the current time." I'm going to have about 20 - 30 links changing, possibly daily. In light of that, would CGI be better?
    I guess you missed SSI include virtual, which does what nogdog suggests but with zero programming required.

  8. #8
    Join Date
    Aug 2004
    Location
    AK
    Posts
    186
    um..use a stylesheet..make images of the buttons and add a class to the links and in the stylesheet make a class and make a background-image thing for each button..then all you need to do is update those button imagesd..and they update on all pages

  9. #9
    Join Date
    Dec 2004
    Posts
    11
    OK, thanks everyone.

    I went with PHP require, and it seems to be simple enough for me.

    One problem I'm having, however, is that the include files are adding an extra space at the bottom of their respective tables, and it's throwing off the whole alignment!! ...so it's something like this...

    INDEX.PHP
    <table>
    <tr>
    <td>
    <?php require ("www.blah.com/heading.html"); ?>
    </td>
    </tr>
    </table>

    HEADING.HTML
    <table>
    <tr>
    <td>
    Here are my heading links...
    </td>
    </tr>
    </table>

    So on the main page (index.php), it will show my heading links, with an empty line just below them before going on to the next row. I hope that made sense...

    -BobDonut

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles