Empty Top Level Content Node (NodeID: 2)

Author Message

Paul Brandt

Wednesday 13 September 2006 6:27:54 am

For some reason I cannot access the top level content node, NodeID=2, whilst in the admin interface there are several folders present as child nodes.

My objective is to build a navigation tree, based upon the content node tree (hey, don't we all....).

Running the following code in the pagelayout.tpl

<p>current node_id: {$module_result.node_id}</p>
{$module_result.node_id|attribute( show, 3 )}

<i>Treemenu operator result:</i>
{def $menus=treemenu( $module_result.path, 2) }
   {section name=topMenu loop=$menus}
   <a href={$topMenu:item.url_alias|ezurl}
      title="{$topMenu:ite.text}">{$topMenu:item.text}</a>
   {/section}
{undef $menus}

<b>Next Paragraph</b>

results in:
current node_id: 2
<b>Attribute Type Value</b>

<i>Treemenu operator result:</i>

<b>Next Paragraph</b>

This is weird, especially since the admin interface confirms node 2 has got 9 subitems (all folders). It further indicates:
Visibility: Visible
Section: Standard
Node ID: 2
Object ID: 147
Author: administrator
Location: LedenWeb (= the name of the top level content node)

I'm running ezPublish version 3.6.3

Anyone any idea what I'm doing wrong here (and even better: has got a solution to this)?

Thanks in advance
Paul

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

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

eZ debug

Timing: Jan 18 2025 19:37:56
Script start
Timing: Jan 18 2025 19:37:56
Module start 'layout'
Timing: Jan 18 2025 19:37:56
Module start 'content'
Timing: Jan 18 2025 19:37:57
Module end 'content'
Timing: Jan 18 2025 19:37:57
Script end

Main resources:

Total runtime0.6035 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1484152.6406
Module start 'layout' 0.00560.0022 741.789139.4766
Module start 'content' 0.00780.5944 781.2656625.9609
Module end 'content' 0.60220.0013 1,407.226616.1250
Script end 0.6035  1,423.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5556160.0002
Check MTime0.00140.2276160.0001
Mysql Total
Database connection0.00090.142810.0009
Mysqli_queries0.538089.1462680.0079
Looping result0.00060.1020660.0000
Template Total0.579596.020.2897
Template load0.00200.325620.0010
Template processing0.577595.687320.2887
Template load and register function0.00020.037610.0002
states
state_id_array0.00070.117110.0007
state_identifier_array0.00070.119320.0004
Override
Cache load0.00180.2977630.0000
Sytem overhead
Fetch class attribute can translate value0.00090.143330.0003
Fetch class attribute name0.00130.217370.0002
XML
Image XML parsing0.00090.149130.0003
class_abstraction
Instantiating content class attribute0.00000.002070.0000
General
dbfile0.00080.1255160.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 43
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs