Re: [SMARTY] Calling for template blocks within the same template file

From: Date: Tue, 19 Nov 2002 10:27:55 +0000
Subject: Re: [SMARTY] Calling for template blocks within the same template file
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6472@lists.php.net to get a copy of this message
On Tue, Nov 19, 2002 at 11:41:47AM +0200, news.php.net wrote: > {* COMMON_BLOCK, template block, common for showing news, announces and so > on ..., WHICH I WOULD LIKE TO CALL FROM THE ONES ABOVE (NEWS_BLOCK and > ANNOUNCES_BLOCK), but it SHOULDN'T BE PROCESSED, while I do not need it! *} > > <TABLE> > {foreach from=$data item=data_item} > <TR> <TD>{$data_item.subject}</TD>... > {/foreach} > </TABLE> > {* end of template block, common for showing news, announces and so on ... > *} > Naturally, the COMMON_BLOCK part should be processed by smarty, intil I call > it explicitely, when needed. I dit not tested it, but maybe you can use {section} with show off, to load the common block into the variable. In COMMON BLOCK change { and } to {rdelim} and {ldelim}. Then call common block variable with {eval} (plugin) statement. -- Piotr Klaban

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