Thanks for the pointer, Bernd. I'm using v3.0RC2, so the API is a bit
different (uses a Comparator, instead of a constant).

I'd rather been hoping to avoid having to dive into the API, as I'd already
written the presentation stuff using the tag libraries. However, I think
thanks to your suggestion, I see how to wire those bits together now.

Thanks for the pointer!

Sean


On 9/22/06 10:48 AM, "Bernd Brenner" <[email protected]> wrote:

> 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
> ----------------------------------------------------------------


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

Reply via email to