Re: HTML_Template_Xipe - documentation?

From: Date: Sat, 28 Jun 2003 21:14:51 +0000
Subject: Re: HTML_Template_Xipe - documentation?
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-6302@lists.php.net to get a copy of this message
Wolfram Kriesing wrote:
Tommy Ipsen wrote:
Wolfram Kriesing wrote:
Tommy Ipsen wrote:
Wolfram Kriesing wrote:
Tommy Ipsen wrote:
Hi everybody, somebody or anybody... I needed af templating system which was not too big and flexible (like Smarty) but still had some nice features among other caching of the outputfiles! I have however had problems finding up-to-date information about this class - does anybody have information on relatively new documentation for Xipe - preferrably in english. Has anybody any information or experience with the quality of this templating system - I can't figure out if my choice of Xipe was the right choice - don't know if the system is still being developed or it has sort of died a slow death? Thanks in advance for your help! Tommy Ipsen, Denmark.
please have a look here http://opensource.visionp.biz/index.php?id=73 on the bottom of the page you can find an extensive doc
Hi Wolfram I've read the entire doc and it has helped me getting started - though I find it a bit lacking on several topics. I would however really like to se more practical examples since I don't have any previous experience with templating systems. I think I get the basic idea but I'm also pretty certain that I'm making "stupid" inefficient solutions and I'm missing "standard solutions to common problems" as well as neat tricks! If anyone has source-code utilising Xipe I would very mouch like to have a look at it - not necesarily complete working (compilable) source-code but just pieces of source-code using Xipe - to get ideas as well as the "That's the way to do it" experience!
you can have a look in the docs (examples) which are distributed with the pear-package. the source can also be found here http://cvs.php.net/cvs.php/pear/HTML_Template_Xipe/docs there are a lot of examples, which show you how to use it hth
That helped a lot - though it bothers me I didn't thought of it myself... Well I have another problem now regarding the use of nested templates - if that is indeed the correct solution... :-? I have my index.php which does all the logic and index.tpl which (quite simplified) has the following structure: <html> <body> *stuff* <table>
    <tr>
      <td>{$menu-navigation}</td>
      <td>###content###</td>
    </tr>
</table> </body> </html> the actual content is what causes my problems! The content is dependent on a contentid and is located in a database with the following structure: CREATE TABLE contents ( id smallint(5) unsigned NOT NULL auto_increment, heading varchar(255) NOT NULL default '', content longtext NOT NULL, lastmodified timestamp(14) NOT NULL, PRIMARY KEY (id) ) TYPE=MyISAM; The content can be structured like the following: Normal contentpage: heading (heading field in db) textbody (content field in db) This makes it easy for non-geeks to easily edit the content of the pages without thinking about html. The problem however is the "advanced" contentpages where the textbody might include placeholders - for example: Linkpage: Links Here you can se different links for blalblablalb.... [###links###] Please fell free to visit any site blblalblba... Where "[###links###]" is supposed to be replaced by the results of a query to the database. The "advanced" content can contain both ordinary text as well as special placeholders supposed to be replaced by dynamically generated content. If the content were placed in templatefiles in the filesystem it would be easy to include in the index template-file but when the content is placed in a db I don't seem to have the same opportunity!? I can't even tell if my explanation of the problem is understandable or what the "smart" solution to the problem should be... Thanks for all your help so far! PS: Perhaps I should use a custom-made filter or something like that?
if i understand you right, you dont want to read the template from a file, but from a db-table, right? xipe is not prepared for that be default. but what you can simply do is write a filter, which does that (by replacing you ###content### tag by the db-content) or you can replace the ###content### by {include /path/to/content.php} which is a normal php-include, that does the db-reading and echo's the content you read from the db. hth Hi Wolfram
I just wanted to thank you for your help - after thinking about the problem I decided to move the content to the filesystem instead and use a db-table to keep track of the files/content. This however raises another problem when I need the subtemplates to be parsed - I've posted a new question in the newsgroup since it's rather off-topic for this thread! Cheers, Tommy

« previous php.pear.general (#6302) next »