Re: order topitems by a dynamic data field
Jonathan Linowes <[email protected]>
| Newsgroups | gmane.comp.cms.xaraya.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Rodrigo,
The topitems template (e.g. mytheme/modules/articles/blocks/topitems-
mypubtype.xt) receives an array $items containing the items.
You can resort the list before displaying it.
Here's a sort function you can drop into articles/xaruserapi or your
own module
http://www.vaporbase.com/postings/Functions_for_grouping%2C_sorting%
2C_and_filtering_items
and then do something like this before the <xar:foreach> in the
template,
<xar:set name="items">xarModApiFunc('articles','user','sortitems',
array('items'=>$myitems, 'field'=>'myfield'))</xar:set>
linoj
On Mar 25, 2007, at 9:42 AM, Rodrigo Lazo wrote:
> hi everybody,
>
> I have a publication type that works like a TODO list, and I'm using
> the topitems block to show te latest five on my index page. This pub
> type uses a DD field to store the deadline for the task, so I need to
> show the top5 items sorted not by the creation date but by this date.
>
> How could I do it?
>
> Thanks
>
> --
>
> Rodrigo Lazo (rlazo)
> _______________________________________________
> Xaraya_user mailing list
> [email protected]
> http://xaraya.com/mailman/listinfo/xaraya_user