[opencms-dev] Ordering by a custom date field
Jose Ignacio Yarza
jiyarza at opensistemas.com
Fri Jan 20 11:32:20 CET 2012
Hi Khởi,
Thank you for your reply.
The sentence I wrote loads all the files whose name matches the pattern
"content_%(number).html" inside the directory "/internet/news/notes/".
ie:
content_123123123132.html
content_128379173987.html
...
A custom module appends a timestamp to each new content file of this
type.
What we want to do is loading the full directory but we need to use a
custom date field for ordering (MyDate) instead of the collector.date or
the automatic publish date.
Thanks!
On Fri, 2012-01-20 at 17:22 +0700, Khởi Nguyễn Văn wrote:
> hi Jose,
>
>
> I don't understand %(number) of you which it means what?
>
>
> - do you want to load a file which its "Structured Content
> = MyContentType" & "file's name=content_1.html" & "on
> folder /internet/news/notes/" ?
> if it's right, you use code:
> <cms:contentload collector="singleFile"
> param="/internet/news/notes/content_%(number).html" editable="true">
>
>
> - if you want to load some of files which our "Structured Content
> = MyContentType" & "on folder /internet/news/notes/"
>
>
> <cms:contentload collector="allInSubTreePriorityDateDesc"
> param="/internet/news/notes/|MyContentType|15" editable="true">
>
>
>
>
> good luck!
>
> 2012/1/20 Jose Ignacio Yarza <jiyarza at opensistemas.com>
> Hello List,
>
>
> This is my first post so greetings to everyone, and please
> bear with me.
>
> I have a custom schema with this date field defined in it:
>
> <xsd:element name="MyDate" type="OpenCmsDateTime" minOccurs="1" maxOccurs="1" />
>
>
> I need to show listings ordered by this custom field. With some researh I found a collector and tried this in the JSPs:
>
> <cms:contentload
> collector="allInFolderDateDesc"
> param="/internet/news/notes/content_%(number).html|MyContentType|15|MyDate"
> pageSize="${param.pageSize}"
> pageIndex="1"
> editable="false">
>
>
> But it does not work as I expected the list ordering is
> somewhat arbitrary. I have not found much documentation about
> this collector in particular so maybe something is wrong
> there.
>
> Any help is very appreciated. This is a production system in a
> public administration, and this change is important for my
> customer since currently it shows the news disorderly.
>
>
> Version is OpenCMS 7.
>
>
> Thank you,
>
> Jose
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list,
> please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
>
>
>
>
> --
> Best Regards,
> ------------------------
> Nguyen Van Khoi
> Sutrix Media - Developer
>
> Mobile: 0976.593.588
> Skype: vankhoiqn2003
> Yahoo: vankhoiqn2003
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
--
Open Sistemas
Jose Ignacio Yarza Vidal
Telf: 649 157 537
More information about the opencms-dev
mailing list