SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    UK
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Site Navigation / Page Layout Templates... (PHP??)

    Hiya...

    I want to re-design my website so that it doesn't use frames, and so it is possible to have a navigation bar to the left of every single page.

    The problem is that the site is growing rapidly and it would take a ridiculous amount of time to re-write every HTML file. I am especially concernced because I know I will need to add new links to the navigation bar quite frequently, and updating 100s of HTML files every week is not my idea of fun.

    I've seen another website which (I think!) uses PHP to do exactly what I have in mind. From what I can gather, the site has some kind of a template for the navigation system which is imported into the HTML file so that it is displayed on every page exactly the same. To update it, you only need to update the template and it automatically affects every page on the site.

    I REALLY want to be able to do this!

    I've been reading up on PHP and working thru some of Kevin Yank's articles on this site, but I can't seem to find anything which tells me how to do this. Please bare in mind that I am a complete beginner when it comes to PHP (although I do have some coding experience and I am a little over-familiar with HTML and JavaScript...)

    If anyone could point me in the right direction of a tutorial, article or even just send me some source code which I could adapt and implement into my own site then I would be eternally grateful!

    Thanks... Jay.

  2. #2
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jay,

    what you need to do it just set all your file extensions to .php

    create the template to be placed in a file/database.
    in the various html pages, just add the code to execute/load the file. and poof. a basic template system.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  3. #3
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could also think of using Server Side Inluces instead.

  4. #4
    SitePoint Member
    Join Date
    May 2001
    Location
    UK
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys... I've since found some scripts with the file extensions .inc - I guess these are includes, right? Anyway, I have been experimenting with them and they work they way I want them to, so.... problem solved!

    Thanks again for your help.

    Jay


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
  •