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 ...

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 20 2025 08:55:27
Script start
Timing: Jan 20 2025 08:55:27
Module start 'layout'
Timing: Jan 20 2025 08:55:27
Module start 'content'
Timing: Jan 20 2025 08:55:27
Module end 'content'
Timing: Jan 20 2025 08:55:27
Script end

Main resources:

Total runtime0.0261 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.2891152.6406
Module start 'layout' 0.00700.0037 741.929739.4922
Module start 'content' 0.01070.0127 781.421989.3828
Module end 'content' 0.02340.0026 870.804734.3047
Script end 0.0260  905.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.6618140.0002
Check MTime0.00124.6927140.0001
Mysql Total
Database connection0.00103.824010.0010
Mysqli_queries0.003312.498930.0011
Looping result0.00000.084110.0000
Template Total0.00207.610.0020
Template load0.00093.524110.0009
Template processing0.00104.018810.0010
Override
Cache load0.00062.427710.0006
General
dbfile0.005019.148380.0006
String conversion0.00000.042140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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