Share » Forums » Setup & design » Usage of an if statement

Usage of an if statement

Usage of an if statement

Thursday 31 July 2008 11:21:17 am - 2 replies

Author Message

André R.

Thursday 31 July 2008 12:06:34 pm

<ul>
{def $nodes = fetch( 'content', 'tree', 
                            hash( 'parent_node_id', 61 ) )}

{foreach $nodes as $node}
{if $node.parent_node_id|eq(61)}
            <li class="sub_category">{$node.item.name|wash}</li>
{/if}
    <li class="product_item"><a href={$node.url_alias|ezurl}>-{$node.parent_node_id}- {$node.name|wash} </a></li>

{/foreach}
</ul>

I'm not quite sure what you're using the if and it's content for, can't make any sense of it, but at least this should be without your bugs, I guess you have copy pasted code from old code (witch probably used sequence operator, where it was more normal to use namespace, aka ":" aka $Nodes:item.something ).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Diederik Died

Monday 04 August 2008 12:01:27 pm

Thanks André! That indeed helped me on my way. Sorry if my explanations waren't clear of my purpose, but evenso you where able to push me in the right direction. Thanks again!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu