Forum Moderators: coopster

Message Too Old, No Replies

html static page to template php

trying to create a simple include that pulls correct body content in...

         

gleddy

6:32 am on Mar 1, 2005 (gmt 0)

10+ Year Member



heya,

I am a total newbie to php and have searched in vain but this is what I am trying to do...

I have a site (approx 7 pages for now...) with a common header and footer. The content area will be different for each page, so I want to use the same HTML template, and just pull in the correct content to the body for each page when required.

I am looking for tuts but most seem really complex. I have created this simple template before in ASP and it came down to simply reading the url (the ID='something' bit), and using a <case> argument to decide which <include> to pull in...

can somebody point me in the right direction?

cheers!

NickCoons

6:40 am on Mar 1, 2005 (gmt 0)

10+ Year Member



You can use the same technique, but instead of <case>, check PHP's site for a function called switch().

ironik

9:16 pm on Mar 1, 2005 (gmt 0)

10+ Year Member



Also another suggestion, although it might be a bit more than what you need for just 7 pages.

Try a template system:
[smarty.php.net...]

I've used several systems and smarty is probably the best. When you are building larger sites a template system is a godsend.

gleddy

10:23 pm on Mar 1, 2005 (gmt 0)

10+ Year Member



thanks guys...

ended up going through my old asp code and figuring out the translation into php...

now I created a template html that reads the ID=<whatever> and then implements the correct body content and page title.

quite proud of myself for my first php project! this language seems a bit more intuitive than php, looking forward to dabbling more.