Sunday 23 January 2011 7:36:48 am
Hello Simone, it seems you made a mistakes in your template code:
-
The content/node fetch function retrieve a node and you use it to retrieve an array.
In your code, $menu_item is not an array but a node.
- The content/node fetch function needs a node_id in argument and you passed it $menu which is an array
If you want to get an array of nodes, you need to use such a code :
{def
$menu = ezini('PLPMenu', 'MenuArray', 'plp.ini')
$nodes = array()
$current_node = false()
}
{foreach $menu as $node_id}
{set $current_node=fetch( 'content', 'node', hash( 'node_id', $node_id ))}
{if is_object($current_node)}
{set $nodes = $nodes|append($current_node)}
{/if}
{/foreach}
{undef $menu $nodes}
Then, in your config file, you can get an order if you use an index. For example, you can modify your code to get:
[PLPMenu]
MenuArray[]
MenuArray[1]=121
MenuArray[2]=60
MenuArray[3]=61
MenuArray[4]=62
MenuArray[5]=63
MenuArray[6]=111
--
Developer at Open Wide
|