Re: [Phplib-users] Problem repeating nested templates
Brought to you by:
nhruby,
richardarcher
From: J C L. <cl...@ka...> - 2002-01-02 18:20:12
|
On Mon, 31 Dec 2001 09:10:20 -0600 Layne Weathers <la...@of...> wrote: >> How, using the current template.inc, can you repetitively use the >> same template, expanded with different values, into other >> templates? >> >> Example: >> >> <!-- BEGIN top --> (item) <!-- END top --> >> >> <!-- BEGIN item --> (links) <!-- END item --> >> >> <!-- BEGIN block --> (links) <!-- END block --> >> >> <!-- BEGIN links --> {link} <!-- END links --> >> >> And I want "top" containing multiple instances of "item" and >> "block", with each of those sub-blocks containing a different >> "links". The obvious approach doesn't work because the first >> time I parse "links" to then build a block or item the template >> is lost so I can't come back later with a new value for "link" >> and gen a new value to later shove in a new block or item. > Although you are parseing the "links" block into several places, > you need to name the target variables separately ({some_links}, > {some_other_links}, etc). That's not the problem. The core of the problem is that set_block() replaces the instance of the template in the file with {$name}. The core of the problem is that is replaces $parent with {$name}, where $parent is the name of the template (eg "links" above), and so can't be varied on a per-call basis. -- J C Lawrence ---------(*) Satan, oscillate my metallic sonatas. cl...@ka... He lived as a devil, eh? http://www.kanga.nu/~claw/ Evil is a name of a foeman, as I live. |