How to count the number of pages??

Author Message

M M

Wednesday 09 February 2005 5:36:12 am

Dear all

I need your help ... please, i want a way to get count of pages in a specific template

ex: i need to know how many pages displayed in them the news titles or a gallery of pictures if each page carries 5 items

also i need to know how to specify in which page am i ??

Thanks in advance

Tom Couwberghs

Wednesday 09 February 2005 5:53:25 am

Do the same fetch-operation as you did to fetch the news or galleryitems, but use list_count or tree_count instead of list or tree.

If you have the number of items, divide it by 5 and than you can see how many pages there are.

Like this:

{ceil(div($treecount, 5))}

Hope this helps,

Tom

M M

Sunday 13 February 2005 3:47:47 am

Thanks a lot it works well

But i need an answer for two more questions if you please...

First: how to know in which page i am [ its number]

Second: if i want to display all numbers of pages in a combobox and each should be hyperlinked to its page

Thanks in advance

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

Main resources:

Total runtime1.8494 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9375152.6250
Module start 'layout' 0.00520.0034 740.562539.4453
Module start 'content' 0.00851.8392 780.0078500.3281
Module end 'content' 1.84770.0016 1,280.33598.1563
Script end 1.8494  1,288.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.1957160.0002
Check MTime0.00140.0753160.0001
Mysql Total
Database connection0.00060.034510.0006
Mysqli_queries1.789996.7834570.0314
Looping result0.00080.0455550.0000
Template Total1.806497.720.9032
Template load0.00220.117920.0011
Template processing1.804297.555320.9021
Template load and register function0.00020.011410.0002
states
state_id_array0.00240.129910.0024
state_identifier_array0.00230.123320.0011
Override
Cache load0.00180.0955220.0001
Sytem overhead
Fetch class attribute can translate value0.00120.064620.0006
Fetch class attribute name0.00180.099540.0005
XML
Image XML parsing0.00070.038420.0004
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00220.1186160.0001
String conversion0.00000.000540.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs