Technique #1:
- Single index.php file which includes header.php, navigation.php, footer.php and content files depending on URL variable.
Problems #1:
- You can't add individual .CSS files specific to your content pages because they have to be added in the main index.php file and may conflict with other content pages.
- If you have javascript's needed for specific content pages you MUST load all potentially used JS files in the index.php file. This means you unnecessarily load JS files for content pages where they aren't needed.
Technique #2:
- template.php file for each major page of website which includes header.php, navigation.php, footer.php. Content is not included via a file but rather the template file is used as the content file.
Problems #2:
- Any changes made to the the template has to be duplicated to every other major page manually.
I started using technique #1 until I ran into major javascript issues. I am now considering moving to technique #2 and just dealing with template changes as necessary.
What technique do you use and how do you solve the CSS/JS include issue?