Forums / Setup & design / Empty Top Level Content Node (NodeID: 2)

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

eZ debug

Timing: Jan 18 2025 16:05:01
Script start
Timing: Jan 18 2025 16:05:01
Module start 'content'
Timing: Jan 18 2025 16:05:01
Module end 'content'
Timing: Jan 18 2025 16:05:01
Script end

Main resources:

Total runtime0.2431 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 587.8281180.8281
Module start 'content' 0.00910.0081 768.6563102.0547
Module end 'content' 0.01720.2258 870.7109532.3750
Script end 0.2430  1,403.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00421.7309200.0002
Check MTime0.00170.7184200.0001
Mysql Total
Database connection0.00070.269410.0007
Mysqli_queries0.178273.29801410.0013
Looping result0.00200.82931390.0000
Template Total0.225192.610.2251
Template load0.00100.416410.0010
Template processing0.224192.178610.2241
Override
Cache load0.00070.287610.0007
Sytem overhead
Fetch class attribute can translate value0.00080.343110.0008
XML
Image XML parsing0.00030.110710.0003
General
dbfile0.00311.2949200.0002
String conversion0.00000.005730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs