Smarty Nested foreach loop question

pbcnx

New Member
I am having trouble getting the below array to display properly in a smarty template file. If anyone can help point me in the right direction I would be most thankful. my template code looks like this:\[code\] {foreach from=$trackingGroups item=gender key=k item=v} {assign var=tc value="http://stackoverflow.com/questions/3552456/`$v.id`"} {$v.title} ({$v.productCount})<br />\[/code\]{foreach item=department from=$trackingGroups.$tc item=v2} {$v2.title}
{/foreach} {/foreach}but the page displays like this:\[code\] Women (3)<br /> W<br /> 7<br /> 3<br /> Footwear<br /> Accessories<br /> Men (2)<br /> M<br /> 7<br /> 2<br /> Footwear<br />Array\[/code\]( [71] => Array ( [title] => Women [id] => 71 [productCount] => 3 [171] => Array ( [id] => 171 [title] => Footwear [productCount] => 2 [74] => Array ( [id] => 74 [title] => Boots [productCount] => 2 )\[code\] ) [172] => Array ( [id] => 172 [title] => Accessories [productCount] => 1 [74] => Array ( [id] => 74 [title] => Boots [productCount] => 1 ) ) )[72] => Array ( [title] => Men [id] => 72 [productCount] => 2 [171] => Array ( [id] => 171 [title] => Footwear [productCount] => 2 [74] => Array ( [id] => 74 [title] => Boots [productCount] => 2 ) ) )\[/code\])
 
Back
Top