Hello all, Great forum! It seems there are many experts here. This might be a quick question someone could easily answer. I have exactly the same code in many of my web site's pages. It's navigation bar code. Would it be best to store this in another file and bring it into each page with just a couple of similar lines of code in each page? Thanks in advance for your advice. Wally
That would be one of the better option. Other option could be to have a template based and fetch the header / navigation for each page and if some pages don't need it you can avoid the fetching for that page.
Say you have templates and read the content of the template file from the xyz.php based on the requirement and build on the html of the pages.
Newbie... Sorry, don't know what a template file or php is... could you help by elaborating (example) please. Thanks
A template file is some file which has some html code in it. Say I have 2 files header.html body.html footer.html Which contains the specific html content for the header, body and footer respectively and based on the requirement you can get the content of the file and append it to the page as and when needed.
Is this a cut and paste process? Where you specify body.html, I have several 'main' pages of bodies...... If I had a main1.html, main2.html, and main3.html for example, would I cut and paste the header and footers into these three documents? Thank you again!
How simple or complex your case would be is upto your initial design but it should be simple segregation of html and web server language as far as I can see it.