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.