Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS and Templates Re: CSS and Templates

#91783
brentwpowell
Member

To further expound on @TheDoc and @standuncan said, it would go something like this:

Take for example this really simple html markup. For all intents and purposes, this would be an “index.html” page.



Page Title - Site Name




Site Name





Page Title


Some content that probably matters would go here




© 2011 Your Awesome Company - (012) 234-5678

All that would really ever change in this document would be the “stuff” between the opening and closing section tags, with the header and footer sections being constant throughout. To make our header and footer “template” regions, we would create three new php files, header.php, index.php and footer.php.

This is what the header.php file would look like:



Page Title - Site Name




Site Name



The footer.php:


© 2011 Your Awesome Company - (012) 234-5678

The magic then happens in the index.php where you would do just as @TheDoc said and include the two php files we just created.
It would look like this:

    

Page Title


Some content that probably matters would go here



Notice that we called for the header.php and footer.php parts. You can expand this as far as you want. When you need to add a new page, just make sure to include you header and footer files, give it a new name (eg. about.php) and you all of a sudden have an instant template. Hope this helps you @goaltech!