Forums / Setup & design / Node id organization does'nt work aft template code changed!

Node id organization does'nt work aft template code changed!

Author Message

Guilherme Longo

Friday 05 October 2007 2:00:24 am

Hi friends.
I've one simple problem with my node organization.
I was organizing my menu using priority, but was necessary make some modifications on the template code. My page is working perfect but the organization that was seted in ezwebin interface does'nt work after those changes!

I though in 2 things:

1º - Change the nodes id of my nodes and organize via template code by id order, or make some code tho show in order using their respective node id.

Somebody has some suggestion?

Thank very much!

Guilherme Longo

Monday 08 October 2007 4:23:43 am

People, i dont find nothing yet to solve my problem!

Nobody know if is possible change node id of one node already created?

and Some body knows how does work the organization by priority? wich script has the responsability to do that organization?

Great Regds;

André R.

Monday 08 October 2007 5:35:51 am

When you have problem with your own code, you will get a whole lot more answears if you post it.

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

Guilherme Longo

Monday 08 October 2007 6:05:30 am

I'll try to explain what I did exactly:

I have one template that show my menu:
the code is quite simple and I just added these 2 bolds line:

If I remove these 2 lines, my organization by priority works perfect.
I just want to know how does work organization by priority, I want to read the code to try understand what is happening.

Some body know in which file I can find it?

I mean for example ... /settings/organize.php !

Follow bellow the code:

<div class="topmenu-design">
<!-- Top menu content: START -->
<ul>
{def $root_node=fetch( 'content', 'node', hash( 'node_id', $indexpage ) )
$top_menu_items=fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id, 'class_filter_array', ezini( 'MenuContentSettings', 'TopIdentifierList', 'menu.ini' ) ) )
$top_menu_items_count = $top_menu_items|count()
$item_class = array()
$current_node_in_path = cond(and($current_node_id, gt($module_result.path|count, $pagerootdepth)), $module_result.path[$pagerootdepth].node_id, 0 )}
{if $top_menu_items_count}
<b>{foreach $top_menu_items as $key => $item}</b>
<b>{if $item.node_id|ne( 187 )}</b>
{set $pagerootdepth = $root_node.depth}
{set $item_class = cond($current_node_in_path|eq($item.node_id), array("selected"), array())}
{if $key|eq(0)}
{set $item_class = $item_class|append("firstli")}
{/if}
{if $top_menu_items_count|eq( $key|inc )}
{set $item_class = $item_class|append("lastli")}
{/if}
{if $item.node_id|eq( $current_node_id )}
{set $item_class = $item_class|append("current")}
{/if}

{if eq( $item.class_identifier, 'link')}
<li id="node_id_{$item.node_id}"{if $item_class} class="{$item_class|implode(" ")}"{/if}><div><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $item.node_id)|ezurl}{else}{$item.data_map.location.content|ezurl}{/if} target="_blank"{if eq( $ui_context, 'edit' )} onclick="return false;"{/if}><span>{$item.name|wash()}</span></a></div></li>
{else}
<li id="node_id_{$item.node_id}"{if $item_class} class="{$item_class|implode(" ")}"{/if}><div><a href={if eq( $ui_context, 'browse' )}{concat("content/browse/", $item.node_id)|ezurl}{else}{$item.url_alias|ezurl}{/if}{if eq( $ui_context, 'edit' )} onclick="return false;"{/if}><span>{$item.name|wash()}</span></a></div></li>
{/if}
{/if}
{/foreach}
{/if}
{undef $root_node $top_menu_items $item_class $top_menu_items_count $current_node_in_path}
</ul>
<!-- Top menu content: END -->
</div>

great regards;

Guilherme Longo

Monday 08 October 2007 6:36:56 am

Is solved!!!!! ;o)

Was nescessary add this:

$top_menu_items=fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
<b>'sort_by', $root_node.sort_array,</b>
class_filter_type', 'include',
'class_filter_array', ezini( 'MenuContentSettings', 'TopIdentifierList', 'menu.ini' ) ) )

Thanks!