How to have code to pass for x no. of html files

Discussion in 'HTML & Website Design' started by contactpro, Dec 27, 2007.

  1. #1
    actually I was planning to launch html based gallery. Since, its an automated web gallery, it's impossible for me to edit each and every html file to get my code in.

    I want to add my header links in all my files, I was just looking if any one could help me how to achieve it. Just editing or including 1 page/file must embed in all the html pages in the particular directory
     
    contactpro, Dec 27, 2007 IP
  2. moodswing

    moodswing Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You could use php to include your header and footer.
     
    moodswing, Dec 27, 2007 IP
  3. mistnee

    mistnee Well-Known Member

    Messages:
    108
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    158
    #3
    if you use dreamweaver, a simple solution would be to "find and replace" your "entire current local site" or "folder" by selecting a part of the html code in the header and adding whatever you want to add.

    PM me for more details if this will help solve your purpose.
     
    mistnee, Dec 27, 2007 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Otherwise, what you're looking for is called a template engine (not to be confused with a design template). They are usually written in PHP but are also often found in Perl, Python, and other OOP languages. They dynamically load the html for you (thus stuff like your header is only written once, and one change will change that part for ALL your pages). The problem with the ones floating around online is that many of them load the html incorrectly. You can either write your own or try to find one that generally validates (was written by someone who understands and cares about proper html).
    Apparently ones like Mambo and Joomla are closest to decent, but that's heresay as I've never used them myself (my company uses a hand-written Perl one).
     
    Stomme poes, Dec 27, 2007 IP
  5. contactpro

    contactpro Peon

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    actually I am using "Easy Web Gallery" software to create galleries. So, its not possible to do it manually. So, I am looking possible solution to sort out this issue, ya I know about Joomla I had used it but it didn't meet my needs :(
     
    contactpro, Dec 31, 2007 IP
  6. Sabbir

    Sabbir Banned

    Messages:
    210
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Hi, i think if you include a php page with all of your pages then it will work fine. then you need to correct that php page only.
     
    Sabbir, Jan 1, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    ^Tha't's the template, in PHP : )

    On bad thing about PHP is that it lets you write really sloppy code. PHP6 whenever it comes out, will adhere more to the normal programing standards like namespaces instead of just globals. So, while it's one of the easier ones to start out with, it's also easy to make security vulnerabilities too.
     
    Stomme poes, Jan 1, 2008 IP
  8. contactpro

    contactpro Peon

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    actually there are no php files to be published :(
     
    contactpro, Jan 1, 2008 IP
  9. slaydragon

    slaydragon Banned

    Messages:
    1,403
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #9
    u can use htmls , includes
     
    slaydragon, Jan 2, 2008 IP