Count pages in a category

For this trick I use the [module listpages] wich has the variabel %%total%%.

I some cases it can be nice to have an indicator like 3/10 and 4/10… where you can use the %%total%% variable. Like here:

[[module listpages category="book" separate="no"]]
||%%index%%/%%total%%||%%title_linked%%||
[[/module]]

But this trick will only give you the "10" by setting the limit to 1

total pages in "book" category is: 8
[[module listpages category="book" limit="1"]]
total pages in "book" category is: %%total%%
[[/module]]
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License