Including meta data, css links, etc. in an effort to template-ize a site?

4 answers

Ktash 1851
0
points
This was chosen as the best answer

Not sure what you mean by 'ok' but its what I do. All of my projects are templates that include pulling out everything from the doctype declaration to the navigation bar into a separate php file that I call from all my pages. If you mean is it best practice, I couldn't say. If you mean is it practical, I think so. Or if you mean is it possible, than very much yes.

Answered almost 9 years ago by Ktash
danwellman 5600
2
points

Yes, it's totally fine because the server will conglomerate all of the necessary files when handling a request for a page, and deliver the complete HTML page. It won't serve a bunch of PHP files which the browser then translates into a single HTML page, it will serve a single HTML page, as if the browser had requested index.html not index.php.

Answered almost 9 years ago by danwellman
Cyrena 10
2
points

Keep in mind that you will want a different title/description/etc for each page - make sure you have some system by which you can populate those individually.

Answered almost 9 years ago by Cyrena
0
points

I use Smarty and keep sections like header footer, sidebar etc in separate files.

Answered almost 9 years ago by johniram