Hi,

For similar results, you might want to take a look at
http://documentation.magnolia.info/docroot/javadoc/info/magnolia/cms/ util/ContentUtil.html#visit(info.magnolia.cms.core.Content,% 20info.magnolia.cms.util.ContentUtil.Visitor) , with something along the lines of

ContentUtil.Visitor visitor = new ContentUtil.Visitor () {
                    private int count = 0;

                    public void visit(Content node) {
                        count++;
                    }
                };

                ContentUtil.visit(root, visitor);

Mind that in any case, the whole tree is traversed, so that might be heavy on resources, maybe a jcr query could be more efficient.

HTH

g



On Jul 3, 2007, at 19:06 , Sean McMains wrote:

We wrote a little JSP script to recurse though the site and compile this
data for us. Details are here:

http://www.magnolia.info/wiki/Wiki.jsp?page=CountingPages

Hope that helps!

Sean


On 7/3/07 11:00 AM, "Ben Brock" <[email protected]> wrote:

Thanks for the reply, Niko.

I'd be happy with either the number of activated pages or the number of
visible pages.

I did a search within Magnolia Central and no totals are displayed. I do
not have search implemented on my site.

How can I programmatically get the total number of pages?




Ben Brock

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: 03 July 2007 00:48
To: [email protected]
Subject: Re: [magnolia-user] How to get total number of pages

Hi Ben,

Did you mean the number of activated pages ? the number of visible pages
?

I would say the best way would be to execute a search on the repository.

Niko,

On Jul 3, 2007, at 3:58 AM, Ben Brock wrote:

What's the easiest way for me to retrieve the total number of pages on

our site?




Ben Brock

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to