SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Index columns on every page.

    I've got my BYOWSTRWUH&C - 2d edition. I am an absolute beginner.
    On the main page I have a navigation column with entries like "History", "Directions", "Meeting Dates" etc. They all link to their separate pages.
    What I am trying to learn and understand is how I can define the column entries only once so I don't have to manually add them to every linked page.
    I am either missing the explanation in BYOWSTRWUH&C - 2d edition or I am seriously misunderstanding a basic concept.
    Any help to point me to the page and paragraph that addresses this in the book would be very much appreciated.
    Last edited by Mondoray; Jun 10, 2009 at 21:35. Reason: Clarity

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2009
    Location
    Bournemouth (UK)
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a bit above me? sorry

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    In the BubbleUnder com example in the book he has a navigation column on the left
    * Home
    * Contact Us
    * About Us

    And this column appears in the two linked pages.
    If, for example, the navigation column had 20 entries I would have to code it on every page of the linked pages.
    There has to be an easier way where I can define that column once.
    That's what I'm asking.
    Last edited by Mondoray; Jun 10, 2009 at 21:36.

  4. #4
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In FrontPage this can be done using Shared Boarders. How can it be done using HTML and CSS?

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,194
    Mentioned
    17 Post(s)
    Tagged
    5 Thread(s)
    That must be done using a server side language not HTML or CSS. What your looking for in PHP is called a include.
    The only code I hate more than my own is everyone else's.

  6. #6
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So...FrontPage has a Server Side part which allows it to propagate a "Shared Border"?
    How Interesting.
    There's got to be something more to this.

  7. #7
    SitePoint Enthusiast leeham's Avatar
    Join Date
    Apr 2009
    Location
    Sunderland, UK
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to create the code for your navigation in a seperate txt and use Server Side Includes (SSI). Keep reading

    Say you might have three files called index.html (your home page), about.html (about us) and contact.html (your contact page)...

    and in all of these files you want a navigation menu with Three links... Home, About and Contact.

    The code for three links would be something like....

    <a href="home.html">Home</a>
    <a href="about.html">About</a>
    <a href="contact.html">Contact</a>


    If you insert the bold code above into a txt file and save it (eg. nav.txt), this txt file can then be 'called' and used by all of your pages.

    This means the small navigation becomes a seperate file and if it needs editing, it only need editing once in the txt file.

    The txt file should be uploaded to you server and if it is in the same folder as your HTML pages, you should be able to use the code...

    <!--#include file="nav.txt" -->

    ... In your HTML files where you want the code from the txt file to appear.

    Try building one page complete with navigation and cut the navigation out into a txt file and replace it with the include code above...

    IF YOU DO USE THIS METHOD, ANY HTML FILE INCLUDING THE INCLUDE TXT HAS TO BE RENAMED FROM .html to .shtml

    I really hope this makes some sense, it's a while since I've done this!

    Last edited by leeham; Jun 19, 2009 at 05:00.


Bookmarks

Posting Permissions

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