Page 1 of 1

Php Content Management

Posted: Wed Sep 07, 2005 11:01 am
by lisamarie_tt
Hi heres my problem

Description of Task:
I have to help manage the content of php pages by making the designer's work easier. Basically what I need to do is make the php code that populates the page easy to move around without killing the functionality of the page but changing the apperance.

Attempted Solution:
I tried making a meta-data tag system where the php code on the page would be replaced with a text equivalent simliar to that of HTML and saving it as a text file.
For example - echo $row["userName"]; would be replaced with <*convert>USER NAME<*/convert>This way the designer can move around the convert tag any where on his Html page and not have to worry about the php code. He can use the convert tag and any web design and not have to bother me with moving the code.
The txt file is fed into a parser and then converted to the php equivalent.

Problems With Attempted Solution:
1. Unsure how to handle looping with this scenario.
2. Solution becomes too invloved as the quering demands increase.
3. Very case sensitive (can be controlled i guess)

Major Questions:
1. Is there a simpler effective way to achieve what i am trying to do?
2. Do you have any suggestions on manipulation of loops in the current solution?

Posted: Wed Sep 07, 2005 11:12 am
by feyd
looped sections are typically marked by start block and end block markers that the template engine pulls out and uses as the "source" of template data.

you may want to read the template engine thread currently active in the theory board.

Posted: Wed Sep 07, 2005 11:15 am
by lisamarie_tt
I'm reading that thread now and i'm a bit lost :( do you have any sites or other resources that offer information on templating?

Posted: Wed Sep 07, 2005 11:22 am
by feyd
We've had many many discussions about templating and template engines, so I'd like to defer to those instead of rehashing anything. I pulled 164 threads involving both templating and engines.

Search terms:
  • templat* engine*
Settings: "search for all terms" checked; everything else, default.

you could use Smarty.