Forums / Developer / Pagination (ver. 3.4) - problem when only few objects

Pagination (ver. 3.4) - problem when only few objects

Author Message

Helle Andersen

Thursday 14 July 2005 5:07:39 am

I have a general template listing events with pagination for a large number of departments. But some departments only have 1 or 2 events. Even if there is only 1 event the google paginations still shows with Next 1 2 3.
Is the trick to make a section whow ... or is there a parameter to be set?

The code runs as follows:

{default
        offset=0
        year=""
        month=""
        numberOfObjects=10
        flag=0
        language=ezini('RegionalSettings','Locale')
}



{let    articleCount=fetch( content, tree_count, hash(
                parent_node_id, 17701,
                sort_by,array(array('attribute',false(),182)),
                class_filter_type, include,
                class_filter_array, array(24),
                attribute_filter,array('or',
                        array('838', '<' , currentdate()),
                        array('838', '=' , 0))

        ))






       eventlist=fetch( content, tree, hash(
                parent_node_id, $node.node_id,
                offset, $view_parameters.offset,
                sort_by,array(array('attribute',false(),182)),
                class_filter_type, include,
                class_filter_array, array(24),
                        array('838', '<' , currentdate()),
                        array('838', '=' , 0),
                limit, $numberOfObjects
                ))
}


{include name=navigator
         uri='design:navigator/google.tpl'
         page_uri=concat( '/content/view/full/', $node.node_id, '/' )
         item_count=$articleCount
         view_parameters=$view_parameters
         item_limit=$numberOfObjects}

David Eriksson

Friday 15 July 2005 12:43:43 am

eventlist=fetch( content, tree, hash(
                parent_node_id, $node.node_id,
                offset, $view_parameters.offset,
                sort_by,array(array('attribute',false(),182)),
                class_filter_type, include,
                class_filter_array, array(24),
                        array('838', '<' , currentdate()),
                        array('838', '=' , 0),
                limit, $numberOfObjects
                ))

Aren't you missing 'attribute_filter' between array(24) and array('838', ...)?

/David

Helle Andersen

Friday 15 July 2005 1:41:43 am

Ups, sorry - I figured it out: it was simply a matter of parent_node_id, 17701, i.e. sorting from a specific node instead of using $node.node_id.
When you use node id everything works fine.

So you don't need to use sction show or anything - google only emerges if the number of objects is larger than 10.

And you are right about missing the second part of the array ...