[opencms-dev] How can show random news with ContentLoad?

florian.heinisch at 3kraft.com florian.heinisch at 3kraft.com
Mon Apr 28 16:14:35 CEST 2008


Hi,

You could write your own resource collector that retrieves all files of
the specific folder, chooses three files randomly and returns only the
three choosen files. Have a look at the
org.opencms.file.collectors.CmsDefaultResourceCollector to see how such
resource collectors work. There should be a few hints in the mail list
archive how to write your own resource collector, e.g.
http://www.nabble.com/how-to-creat-a-custom-collector-to128492.html#a128492

Hope I could help!

Florian

On Mon, April 28, 2008 3:26 pm, Deiverson Silveira wrote:
> Hi,
>
>
> Im question about this, the param of collector need random news. example:
>
>
> <cms:contentload collector="allInFolderPriorityDateDesc"
> param="${opencms.folder}news${*}.html|news|3" editable="true"> <%-- create
> a date object from date value --%> <li>
> <a href="<cms:link><cms:contentshow element="${opencms.filename}"
> /></cms:link>" title="<cms:contentshow element="Title"/>"></a>
> <p><cms:contentshow element="Teaser" /></p>
> </li>
> </cms:contentload>
>
>
> How can show random 3 news?
>
>
> King Regards,
>
>
> Deiverson Silveira
> SolutionCMS
> www.solutioncms.com
>
> _______________________________________________
> 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/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list