Hi Sean,

I did it (thanks to Erik) like this:

Iterator itCollection = cIndex.getContent( "myColl" ).getChildren( ItemType.CONTENTNODE, ContentHandler.SORT_BY_SEQUENCE).iterator();
while (itCollection.hasNext()) {
        Content tmp = (Content) itCollection.next();
        response.getWriter().write ( tmp.getNodeData("blabla").getString() );
}

You can choose SORT_BY_SEQUENCE, SORT_BY_NAME and SORT_BY_DATE

See the javadoc for "getChildren":

http://magnolia.sourceforge.net/21/apidocs/index.html

Cheers,
Bernd


Sean McMains schrieb:
Hi Folks,

Is there any way to use cms:contentNodeIterator to get paragraphs sorted by
one of their attributes, rather than in the order specified in the admin
console? I've got some events that I'd like to sort chronologically, but
haven't had much luck figuring out a way to do that.

I tried using the cms:query tag to retrieve sorted results so that I could
pass those to contentNodeIterator, but was never able to work out syntax in
either Xpath or SQL formats that would work for this purpose: either the
sort wouldn't work, or it would complain that only the attribute axis was
available for "order by".

Thanks in advance for any info.

Sean


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to