Okay, I am building a failry simple HTML website, which has lots of information pages. What I want to do, if on these pages, call for a certain file, for the header, footer, and menu, rather than creating it on each page, and when I update, having to edit each page individually. How can I do this? Thanks in advance!
You're going to have to use either server-side includes (.shtml) or a server-side programming language (like PHP). Give me a sec while I dig up a post I did on the subject, ok? [And here it is: http://forums.digitalpoint.com/showthread.php?p=2145250#post2145250]
Create a template, then build each page from that template. Within that template make an "editable region" where you will put all the content for each individual page. If you need to make a change an item in a menu, for example, you will only need to do it once. Template will automatically upload that change to each page that was created from it. astra
Hey Ian, I don't think this solution will be very good from a SEO perspective, but I've had luck with a JavaScript solution. You can create a .js file and include it in the top of all of your pages. In the JS file you could have functions called printHeader() and printFooter() printHeader() and printFooter() could read something like: function printHeader(){ var headerText = "<div id='header'>This is my header</div>" document.write(headerText) } function printFooter(){ var footerText = "<div id='footer'>This is my footer</div>" } your HTML could look something like <html> <head> <title>blah</title> <script src="your.js"></script> </head> <body> <script language="JavaScript"> printHeader() </script> YOUR CONTENT HERE <script language="JavaScript"> printFooter() </script> </body> </html> Good luck!!!!
yep i was just about to say the same thing... just create everything in seperate files (as -NB- alluded to with header.php) and then call them in the page ie. <?php include 'header.php'; ?> PHP: [/QUOTE] you individual page content here <?php include 'footer.php'; ?> PHP: [/QUOTE]