Empty Top Level Content Node (NodeID: 2)

Empty Top Level Content Node (NodeID: 2)

Wednesday 13 September 2006 6:27:54 am - 5 replies

Author Message

Claudia Kosny

Wednesday 13 September 2006 6:58:55 am

Hi Paul

Does it work when you add an array('folder') or similar as class_filter?

Claudia

Paul Brandt

Wednesday 13 September 2006 8:09:43 am

Hi Claudia,

Nope, class filter set to 'folder' doesn't help.

In addition, the same behaviour applies for all other nodes as well, hence it is not restricted to the top level content node alone. Leading to the conclusion that maybe the source of the problem is not related to seemingly empty nodes at all; maybe the variable '$module_result' isn't initialized correctly...

If I apply another example for building navigation menus, some output <b>is</b> generated:

{let folder_list=fetch( content, list, hash(parent_node_id, 2, sort_by, array( array( priority ))))}

    <ul>
    {section name=top_level loop=$folder_list}
        <li><a href={concat("/",$top_level:item.url_alias)|ezroot}>{$top_level:item.name|wash}</a>
        {section show=$top_level:item.node_id|eq($module_result.path[1].node_id}
            {let sub_folder_list=fetch( content, list, hash(parent_node_id, $module_result.path[1].node_id, sort_by, array( array( priority ))))}
            <ul>
                {section name=sub_level loop=$top_level:sub_folder_list}
                <li><a href={concat("/",$top_level:sub_level:item.url_alias)|ezroot}>{$top_level:sub_level:item.name|wash}</a></li>
                {/section}
            </ul>
            {/let}
        {/section}
        </li>
    {/section}
    </ul>
{/let}

This results (for nodeID: 2) in:

<ul>
      <li><a href="/~intranet/index.php/verenigingszaken">Verenigingszaken</a>
           <ul></ul>
      </li>
      <li><a href="/~intranet/index.php/de_nmv_kennisbank">De NMV-Kennisbank</a>
           <ul></ul>
      </li>
      .... etc ....
</ul>

So: Why doesn't the 'treemenu' operator behaves like the 'fetch' operator although they operate on the same node? Or don't they operate on the same node?

Again, thanks in advance. I'm really stuck here.
Paul

Claudia Kosny

Wednesday 13 September 2006 1:51:50 pm

Hi Paul

you can easily check the content of $module_result.path using the |attribute function
The output for node 2 should be something like this:

0 	array 	Array(4)
>text 	          string 	'eZ publish'
>url 	           boolean 	  false
>url_alias 	boolean 	false
>node_id 	string 	         2

Unfortunately I do not have a EZ 3.6 to test so I cannot help you much further with this. On my EZ 3.8.3 I do always have to state a classfilter which related to this bug http://ez.no/community/bugs/warnings_when_using_treemenu_without_class_filter_parameter
Anyhow - if you are interested in solving your problem I would suggest checking the file \kernel\common\eztreemenuoperator.php. For the most part it is pretty straightforward so you can see what is actually happening.

Claudia

Paul Brandt

Thursday 14 September 2006 1:37:02 am

Hi Claudia,

Thanks for your response. Apparently I made a dumb typo of some sort since the <i>treemenu</i> operator now behaves correctly when provided with an <i>array('folder')</i> class_filter, circumventing the bug you so kindly informed me about. So, all is well.

All is well? Well not entirely!
"One small village of indomitable Gauls still holds out against the invaders..." ;-)

Jokes aside: for some reason the attribute operator still doesn't want to show anything. The following code:

{$module_result.node_id|attribute( 'show' )}

 

results in an empty list:
<b>Attribute Type Value</b>

and that's all.
Am I experiencing a bug, or do I belong to the majority that should RTFM somewhat better?

Thanks in advance
Paul

Kristof Coomans

Thursday 14 September 2006 7:20:00 am

$module_result.node_id is an integer, not an object or array, that's why you won't get anything with attribute(show)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.