Tree fetching and Google navigator

Author Message

laurent le cadet

Friday 13 October 2006 6:21:59 am

Hi,

I'm using a simple template to sort 1 specific class from a tree :

{section show=$node.object.data_map.show_children.content}
	{let children=fetch( content, tree, hash( parent_node_id, $node.node_id,
			class_filter_type,  include,
			class_filter_array, array( spot ))) }
		
		{section var=child loop=$children}
			{node_view_gui view=line content_node=$child}
		{/section}
	{/let}
{/section}

I'm trying to add a Google navigator to this template.
I checked the quiet complex full/folder.tpl but this one is based on list fetch which is different.

Any hint or code ?

Regards.

Laurent

Kristof Coomans

Friday 13 October 2006 6:24:38 am

The content/list and content/tree fetches are actually the same, they only use other defaults for the parameters.

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

laurent le cadet

Friday 13 October 2006 7:02:36 am

??

If I try this code

{section show=$node.object.data_map.show_children.content}
            {let page_limit=2
                 list_items=array()
                 list_count=0}


                {set list_items=fetch_alias( children, hash( parent_node_id, $node.node_id,
                                                             offset, $view_parameters.offset,
                                                             sort_by, $node.sort_array,
                                                             limit, $page_limit ) )}
                {set list_count=fetch_alias( children_count, hash( parent_node_id, $node.node_id ) )}


            <div class="content-view-children">
                {section var=child loop=$list_items}
                    {node_view_gui view=line content_node=$child}
                {/section}
            </div>

            {include name=navigator
                     uri='design:navigator/google.tpl'
                     page_uri=$node.url_alias
                     item_count=$list_count
                     view_parameters=$view_parameters
                     item_limit=$page_limit}
            {/let}

        {/section}

... which give me the children of the parent_node...normal

but what I need is to print out the children's children and I can't figure out how to do that :(

laurent le cadet

Friday 13 October 2006 7:06:23 am

OUPS !

{section show=$node.object.data_map.show_children.content}
            {let page_limit=2
                 list_items=array()
                 list_count=0}


                {set list_items=fetch( content, tree, hash( parent_node_id, $node.node_id,
                                                             offset, $view_parameters.offset,
															 class_filter_type,  include,
															 class_filter_array, array( spot ),
                                                             sort_by, $node.sort_array,
                                                             limit, $page_limit ) )}
                {set list_count=fetch_alias( children_count, hash( parent_node_id, $node.node_id ) )}


            <div class="content-view-children">
                {section var=child loop=$list_items}
                    {node_view_gui view=line content_node=$child}
                {/section}
            </div>

            {include name=navigator
                     uri='design:navigator/google.tpl'
                     page_uri=$node.url_alias
                     item_count=$list_count
                     view_parameters=$view_parameters
                     item_limit=$page_limit}
            {/let}

        {/section}

:)

laurent le cadet

Friday 13 October 2006 7:11:36 am

...but I still have a problem to retrieve the children_count of the first fetch...

laurent le cadet

Friday 13 October 2006 7:56:07 am

ok...

I used a depth parameter.
In my case it seems to suit my needs because I have always the same structure.

Parent_node > folders >Items

{section show=$node.object.data_map.show_children.content}
            {let page_limit=2
                 list_items=array()
                 list_count=0}


                {set list_items=fetch( content, tree, hash( parent_node_id, $node.node_id,
                                                             offset, $view_parameters.offset,
															 class_filter_type,  include,
															 class_filter_array, array( spot ),
                                                             sort_by, $node.sort_array,
                                                             limit, $page_limit ) )}
                {set list_count=fetch_alias( children_count, hash( parent_node_id, $node.node_id, class_filter_type,  include,
															 class_filter_array, array( spot ), depth, 2 ) )}

            <div class="content-view-children">
                {section var=child loop=$list_items}
                    {node_view_gui view=line content_node=$child}
                {/section}
            </div>
            {include name=navigator
                     uri='design:navigator/google.tpl'
                     page_uri=$node.url_alias
                     item_count=$list_count
                     view_parameters=$view_parameters
                     item_limit=$page_limit}
            {/let}

        {/section}

Hope this help

Laurent

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 22:31:21
Script start
Timing: Jan 18 2025 22:31:21
Module start 'layout'
Timing: Jan 18 2025 22:31:21
Module start 'content'
Timing: Jan 18 2025 22:31:22
Module end 'content'
Timing: Jan 18 2025 22:31:22
Script end

Main resources:

Total runtime0.8235 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 589.1484152.6250
Module start 'layout' 0.00450.0041 741.773439.4453
Module start 'content' 0.00850.8136 781.2188589.4766
Module end 'content' 0.82210.0014 1,370.695320.1563
Script end 0.8235  1,390.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3880160.0002
Check MTime0.00130.1595160.0001
Mysql Total
Database connection0.00050.063610.0005
Mysqli_queries0.761292.4308660.0115
Looping result0.00060.0695640.0000
Template Total0.789395.820.3946
Template load0.00210.249120.0010
Template processing0.787295.589720.3936
Template load and register function0.00010.015410.0001
states
state_id_array0.00090.107110.0009
state_identifier_array0.00090.105820.0004
Override
Cache load0.00170.2061390.0000
Sytem overhead
Fetch class attribute can translate value0.00070.083320.0003
Fetch class attribute name0.00130.153980.0002
XML
Image XML parsing0.00090.112120.0005
class_abstraction
Instantiating content class attribute0.00000.0032120.0000
General
dbfile0.00080.0981220.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs