Forums / Setup & design / Tree fetching and Google navigator

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

eZ debug

Timing: Jan 18 2025 19:10:16
Script start
Timing: Jan 18 2025 19:10:16
Module start 'content'
Timing: Jan 18 2025 19:10:17
Module end 'content'
Timing: Jan 18 2025 19:10:17
Script end

Main resources:

Total runtime1.0764 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.5078180.8281
Module start 'content' 0.00580.9310 770.3359594.5547
Module end 'content' 0.93680.1395 1,364.8906341.3984
Script end 1.0763  1,706.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3805210.0002
Check MTime0.00150.1399210.0001
Mysql Total
Database connection0.00080.077510.0008
Mysqli_queries0.988291.80112030.0049
Looping result0.00310.28422010.0000
Template Total1.047997.420.5240
Template load0.00190.180020.0010
Template processing1.046097.170520.5230
Template load and register function0.00010.009010.0001
states
state_id_array0.00130.118310.0013
state_identifier_array0.00190.179120.0010
Override
Cache load0.00160.1525390.0000
Sytem overhead
Fetch class attribute can translate value0.00200.184830.0007
Fetch class attribute name0.00140.134280.0002
XML
Image XML parsing0.00200.182730.0007
class_abstraction
Instantiating content class attribute0.00000.0041120.0000
General
dbfile0.00350.3221330.0001
String conversion0.00000.000630.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs