dynamic inserts

From: Date: Wed, 11 Dec 2002 20:48:45 +0000
Subject: dynamic inserts
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6737@lists.php.net to get a copy of this message
Hello, This question has been asked before, but I did not find a satisfactory workaround or explanation and now I'm hoping that will change. Basically what I want to do is insert something using a variable, like this: {insert name=$var} Is this possible? What I am attempting to do is load boxes of dynamic content onto a cached page. Different pages have different boxes. I want to assign what boxes should be on each page in the following way: $box = array(); $box[] = "poll"; $box[] = "login"; $smarty->assign("box",$box); And whatnot. Then the template will load through each variable in the array like this: {foreach key=key item=value name=loop from=$box} {insert name=$value} {/foreach} Shouldn't this theoretically work? What am I doing wrong. ~Paul -- Paul Lockaby paul@dostuff.net http://www.dostuff.net

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