PDA

View Full Version : PHP Template-files, howto?


jimtkm
04-18-2005, 07:49 PM
How does one include some PHP scripts inside *_template.html?

raminia
04-18-2005, 08:25 PM
as far as I know you can't since the template codes are loaded as a string inside index.php and you cold not use code within string!

if you want to do something you can do it in the addons (or not recommended by modifying index.php) and providing a new tag for template which acts dynamicaly using php codes you wrote. you can learn to write addons. quite handy.

jimtkm
04-18-2005, 08:31 PM
hmm.. ok, guess i'm just too lazy to write the same header/footer for each template files. thanks

derevaun
04-18-2005, 09:05 PM
I didn't see it in the docs anywhere (I didn't look very hard for it), but I found in index.php that you just make a file header.html and/or footer.html, and PP will use them just like that.

The header needs to have the doctype tag, head element, open body tag and whatever else; likewise the footer should close the body and html elements. And the templates shouldn't duplicate those things.

jimtkm
04-19-2005, 09:39 AM
That's good, but really, being able to run php script within template-files will be real nice. as for addon, i don't really know how to pass parameters with it. anyway, thanks for the reply.

blinking8s
04-19-2005, 09:52 AM
at its current configuration, its not exaclty and effort to copy and past your header anf footer template code in the html document for each template file

also, fullscale templates that split the template up into sections like that can be very limiting to designers, you might want your about page totally different, or the contact me page as a popup...

take forums for example, very standardized, pixelpost and photography on the other hand...is not :)