kelly8 Posted September 25, 2006 Share Posted September 25, 2006 [Mods, if this is not the right forum, plese move it and sorry in advance]Hello, I was wondering if any of you could give me some guides on how to use one "main" template to update all pages on my site (instead of updating each page). Can I set up, more than one "main" templates?For example, if I need to make some changes on left/right/top/bottom side, I only need to make the change on the "main" template and all of the pages will automatically changed.I heard it could be done using php and modifying .htaccess. Tried to read some guides on the internet and did not really get what I am looking at and I don't really understand it. Could you please give me some guides?Thank you in advance. I'd really appreciate itKelly Quote Link to comment Share on other sites More sharing options...
Guest WarpNacelle Posted September 25, 2006 Share Posted September 25, 2006 I'm not sure about any technique modifying .htaccess but an easy method with php is to use the include() function.For example, what I do, is have the code for my header, footer and menu in a seperate file.Then, each content page has the following:[code]include ('header.php');include ('footer.php');[/code]You just put the include() line where you want the code to go and PHP inserts that code right there. So if you wanted to change your site-wide header, you just edit the "header.php" file.(On a side note, they don't have to be .php extensions. It can be .html or even .inc - for include) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.