Thank you for the suggestion; I ended up with

<jsp:scriptlet>
    long begin = 0;
    long end = NUM_NEWS_PER_PAGE -1;
    ArrayList it = null;
    try{
        it = 
(ArrayList)Resource.getCurrentActivePage().getContent("faqVoce").getChildren()
;
        Collections.reverse(it);
        pageContext.setAttribute("myCollection", it);

        begin = getPage(request, "begin");
        end = begin + NUM_NEWS_PER_PAGE -1;
    } catch( PathNotFoundException e) {
        begin = 0;
        end = NUM_NEWS_PER_PAGE -1;
        it = new ArrayList();
    }

    pageContext.setAttribute( "begin", new Long(begin) );
    pageContext.setAttribute( "end", new Long(end) );
</jsp:scriptlet>

// ...

    <cms:contentNodeIterator contentNodeCollectionName="faqVoce" 
items="${myCollection}" begin="${begin}" end="${end}" varStatus="curStatus"
>
<!-- NOTICE THIS IF -->
        <c:if test="${curStatus.index le end }">
...
        </c:if>
    </cms:contentNodeIterator>

Oddly enough the end attribute of the contentNodeIterator tag has a strange
behaviour:

If the collection contains 10 elements and you initialize NUM_NEWS_PER_PAGE
= 1:
* first page has 1 element (starting with the 0st)
* second page has two (starting with 1st)
* fifth page has five elements (starting with 4th)
* sixth page has four (!)
* ...
* nineth page has two
* 10th page has one element

-- 
View this message in context: 
http://www.nabble.com/Paged-news-tp20231805p20364160.html
Sent from the Magnolia - User mailing list archive at Nabble.com.


----------------------------------------------------------------
for list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
----------------------------------------------------------------

Reply via email to