Re: [SMARTY] Smarty and ZopePageTemplates

From: Date: Wed, 19 Jun 2002 19:57:12 +0000
Subject: Re: [SMARTY] Smarty and ZopePageTemplates
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4952@lists.php.net to get a copy of this message
those are just examples of my first few tests. of course you would look for delimiters that would be more sound in use cases and that wouldn't be introduced in the content. the multipass parser would take too long to initially compile if a site has lots of templates like mine. i allow for individual sideboxes along with many areas of the portal to be templated. i could be totally wrong here, so please correct me. and thanks for the regular expressions idea. that will come in handy since i need to build a backwards compatible theme system for postnuke as we already have users with our old set of delimiters. =) -james
From: Monte Ohrt <monte@ispi.net> To: james nguyen <sentinael@hotmail.com> CC: anferr@mecon.gov.ar, smarty-general@lists.php.net Subject: Re: [SMARTY] Smarty and ZopePageTemplates Date: Wed, 19 Jun 2002 13:55:29 -0500 That won't work in all cases, just blindly replacing ']' with '}'. What if ']' is part of the content? You should use a regular expression, something that only replaces ']' that follows the opening '[dts:' tag, and even then it isn't foolproof. Maybe a multi-pass parser... this all sounds too familiar :-) Monte james nguyen wrote:
it's pretty easy to implement actually. i'll give you the prefilter i use to allow for inline tags to work without having to use the main delimiters like <smarty: />. here's the code for a prefilter to use: <?php /* * Smarty plugin * filename: prefilter.inline_tags.php * ------------------------------------------------------------- * used for inline tag attributes in order to build xml * compliant templates. */ function smarty_prefilter_inline_tags($source, &$smarty) {
       $source = str_replace('[dts:', $smarty->left_delimiter, $source);
       $source = str_replace(']', $smarty->right_delimiter, $source);
       return $source;
} ?> use this prefilter to allow for inline tag attributes to be used. in your example, you would use 'tal:' for the left delimiter and i guess '"' ends the attribute, so that can be the right delimiter. after that, you can regisister content as a function in smarty and pass it arguements as you wish. if you have further questions, let me know. -james
From: Andres Ferrando <anferr@mecon.gov.ar> To: "james nguyen" <sentinael@hotmail.com> Subject: Re: [SMARTY] Smarty and ZopePageTemplates Date: Wed, 19 Jun 2002 15:06:03 -0300 Hi, james! I'm really interested on this solution!!! could you tell me more, or send me anything, please? thanks in advance!
i've actually worked out a solution provided my a member on this list
that
allows me to create xhtml templates fine. i have tags such as <dts:BLOCKS side="right" /> and even inline tag attributes such as <body background="[dts:$THEMEPATH]/images/background.jpg"> my site can be found at www.duskyblue.net if you have any questions.
i've
been trying to find out this solution forever to incorporate into the postnuke project. surprised that no one has done this before, or if
they
have they just kept it to themselves. hope to hear from you. ;) -james
-- Andres Ferrando <anferr@mecon.gov.ar>
James Nguyen I/T Professional 600 Anton Boulevard 3rd Floor Costa Mesa, Ca 92626 "The philosophers have only interpreted the world in various was; the point is to change it."
                                  -Karl Marx
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
James Nguyen I/T Professional 600 Anton Boulevard 3rd Floor Costa Mesa, Ca 92626 "The philosophers have only interpreted the world in various was; the point is to change it."
                                  -Karl Marx
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

« previous php.smarty.general (#4952) next »