Re[2]: [SMARTY] alternate 2 includes
| From: | Elgi | Date: | Tue, 18 Mar 2003 15:40:06 +0000 |
| Subject: | Re[2]: [SMARTY] alternate 2 includes | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8714@lists.php.net to get a copy of this message | ||
Hello Monte,
Thanks but it's no good :-(
Only else is ok
{section name=bloc loop=$bloc_centre[1]}
{if $smarty.section.bloc.even}
{if !$smarty.section.bloc_centre[1][bloc].email_address}
{include file="include/bloc_centre_gauche.tpl"
titre="$bloc_centre[1][bloc].titre" color="$bloc_centre[0]"
contenu="$bloc_centre[1][bloc].contenu"
email_address="$bloc_centre[1][bloc].email_address"
email_text="$bloc_centre[1][bloc].email_text"
email_subject="$bloc_centre[1][bloc].email_subject"}
{else}
{include file="include/bloc_centre_gauche.tpl"
titre="$bloc_centre[1][bloc].titre" color="$bloc_centre[0]"
contenu="$bloc_centre[1][bloc].contenu"}
{/if}
{else}
{if !$smarty.section.bloc_centre[1][bloc].email_address}
{include file="include/bloc_centre_droit.tpl"
titre="$bloc_centre[1][bloc].titre" color="$bloc_centre[0]"
contenu="$bloc_centre[1][bloc].contenu"
email_address="$bloc_centre[1][bloc].email_address"
email_text="$bloc_centre[1][bloc].email_text"
email_subject="$bloc_centre[1][bloc].email_subject"}
{else}
{include file="include/bloc_centre_droit.tpl"
titre="$bloc_centre[1][bloc].titre" color="$bloc_centre[0]"
contenu="$bloc_centre[1][bloc].contenu"}
{/if}
{/if}
{/section}
And have you a url for even's doc ?
Le mardi 18 mars 2003 à 16:23:58, vous écriviez :
MO> {section name=bloc loop=$bloc}
MO> {if $smarty.section.bloc.even}
MO> ...
MO> {else}
MO> ...
MO> {/if}
MO> {/section}
MO> On Tue, 2003-03-18 at 09:19, Elgi wrote:
>> Hello smarty-general,
>>
>> I want alternate 2 bloc or 2 includes :
>>
>> {section name=bloc loop=$bloc}
>> //ex : $bloc[bloc] pair (0,2,4,...)
>> {include file="include/bloc_centre_gauche.tpl"}
>> //ex : $bloc[bloc] impair (1,3,5,...)
>> {include file="include/bloc_centre_droit.tpl"}
>> {/section}
>>
>> I have many var in include,
>> i test too wich html and cycle but it's no good.
>> Same result wich include "include/bloc_centre.tpl" and cycle.
>> I test too $smarty.section.bloc.index, index_prev, index_next but it's
>> no good.
>> I search too math function for $smarty.section.bloc.iteration ou
>> rownum
>> for result pair, impair.
>>
>> help me :/
>>
>> --
>> Cordialement,
>> Elgi
MO> --
MO> Monte Ohrt <monte@ispi.net>