template smarty repeat tpl help

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
uptoeleven
Forum Members
Forum Members
Posts: 96
Joined: Sat Dec 04, 2004 10:30 pm

template smarty repeat tpl help

Post by uptoeleven »

I'm sure there is a really sane and sensible answer to this:

in the bullet menu tpl file there is the following:

{if $node->depth > $node->prevdepth}
{repeat string="" times=$node->depth-$node->prevdepth}

now what I want to do (using the explode menu at http://webtechsig.org/Presentations/css/menus/) is:

{if $node->depth > $node->prevdepth}
{repeat string="id')\">$node->menutext" times=$node->depth-$node->prevdepth}

Now that's not going to work because all that is being defined is a string (prior to run-time) so naturally the repeated string will take the value:

id')\">Object->menutext

This isn't entirely useful. I'd like it to be spitting out something like

SHOUTING IS GOOD - eg. the evaluation of $node->id and $node->menutext rather than the fact that they are, indeed, objects... which is useful to know, just not in this context...

Is there a (sane and not coding on crack) way of doing this or am I barking up the wrong dog?
ge0
New Member
New Member
Posts: 7
Joined: Mon Jun 19, 2006 9:28 am

Re: [solved] template smarty repeat tpl help

Post by ge0 »

Whilst looking for a solution for the same problem I found this post.  In the end I used an assign to get the right value before the {repeat}...  Hope someone find this of use.

{assign var='ul' value=$node->id}
{repeat string="" times=$node->depth-$node->prevdepth}
...


Cheers

George
Post Reply

Return to “Layout and Design (CSS & HTML)”