Re: nested templates (sic)

From: Date: Fri, 21 Dec 2001 09:03:59 +0000
Subject: Re: nested templates (sic)
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2355@lists.php.net to get a copy of this message
Thanks Brian, if I synthesize what you said for the benefit of eventual users, one should always have an alternate template (a copy of the original template) for every template that has a non-null risk of being embedded in itself. Additionally and necessarily, one should build a little snippet to first detect any auto-including condition (a template that calls directy itself), and second to escape this condition, by providing the capability to provide, as an alternative, the exact copy of this container template to embed it in. Could be better worded but english is not my first language so excuse me. ----- Original Message ----- From: "Brian E. Lozier" <brian@massassi.net> To: <smarty@lists.ispi.net> Sent: Thursday, December 20, 2001 4:08 PM Subject: [smarty] Re: nested templates (sic) > You just have to have an escape route. > > blah.tpl: > {if $Table} > {include file="blah.tpl"} > {else} > No more tables! > {/if} > > > ----- Original Message ----- > From: "Francois Dumais" <f_dumais@videotron.ca> > To: smarty@lists.ispi.net > Date: 12/20/01 6:59:39 PM > > > > >Thanks for your promptitude, your answer relaxed me. > > > >Is this to mean that reusable templates are not an option when you run the > >risk of calling a template that embeds at any level further this very > >template? > > > >Does the solution lie in the creation of reusable "instances" of tables > >(renamed copies of the template) in order to attain ...generic... > >embedment?? Or is there a better way to do this?? > > > > > >----- Original Message ----- > >From: "Monte Ohrt" <monte@ispi.net> > >To: <smarty@lists.ispi.net> > >Cc: <smarty@lists.ispi.net> > >Sent: Thursday, December 20, 2001 3:22 PM > >Subject: [smarty] Re: nested templates (sic) > > > > > >> use include to recursively include templates within another. > >> > >> {include file="foo.tpl"} > >> > >> And obviously, you can get stuck in an infinite loop if a template > >> includes itself. > >> > >> > Francois Dumais wrote: > >> > > >> > I am new to smarty. I would just like to know what is the basic > >> > technique or mechanism needed in smarty to have embedded (or nested) > >> > templates. Practically speaking I want to have html tables within > >> > html tables. I have tried to include templates that include templates > >> > that include templates, each template being basically built as an html > >> > wrapper around the include call. But it doesn't work. Any hints > >> > would be appreciated. Should we use "fetch", "capture", or > >> > "sections"? > >> > --- > >> > You are currently subscribed to smarty as: monte@ispi.net > >> > To unsubscribe send a blank email to > >> > $subst('Email.Unsub') > >> > Visit Smarty's homepage at > >> > http://www.phpinsider.com/php/code/Smarty/ > >> > >> -- > >> Monte Ohrt <monte@ispi.net> > >> http://www.ispi.net/ > >> > >> --- > >> You are currently subscribed to smarty as: f_dumais@videotron.ca > >> To unsubscribe send a blank email to $subst('Email.Unsub') > >> Visit Smarty's homepage at ù¡ ùß a¿b > >> ¶ið€http://www.phpinsider.com/php/code/Smarty/ > > > > > >--- > >You are currently subscribed to smarty as: brian@massassi.net > >To unsubscribe send a blank email to $subst('Email.Unsub') > >Visit Smarty's homepage at > >http://www.phpinsider.com/php/code/Smarty/ > > > --- > You are currently subscribed to smarty as: f_dumais@videotron.ca > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/

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