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