[opencms-dev] cms:contentload - date created needed instead of datemodified
Marc Schlegel
my.mailing.lists at gmx.de
Mon May 12 15:43:35 CEST 2008
Thanks for the help
In order to use my current mapping I tried to use this priority mapping
with a OpenCmsDate but then I am getting a error
Element 'mappings' cannot have character [children], because the type's
content type is element-only.
Isn't a OpenCmsDate represented by a timestamp (long)? It would be
perfect for me to use this mapping with my date-field instead of an
additional entry.
regards
-- Marc
HuyTran at c-mg.net schrieb:
> I think you can create a complex type (XML structured content) using the
> mapping element with priority in the XSD file as an example bellow. When you
> create a new content of this type, you can put in a Priority number. Then in
> the contentload-tag use collector="allInFolderPriorityDateDesc".
>
> Note that, this will sort the from the highest to lowest number, that makes
> the using of Priority number inconvenient.
>
> I think collector attribute in contentload tag needs to extend in coming
> releases of OpenCms.
>
> <xsd:complexType name="OpenCmsNewsArticle">
> <xsd:sequence>
> <xsd:element name="Name" type="OpenCmsString" />
> <xsd:element name="Position" type="OpenCmsString" />
> <xsd:element name="Description" type="OpenCmsHtml"
> />
> <xsd:element name="Photo" type="OpenCmsVfsFile"/>
> <xsd:element name="Priority" type="OpenCmsString"/>
>
> </xsd:sequence>
> <xsd:attribute name="language" type="OpenCmsLocale"
> use="required"/>
> </xsd:complexType>
> <xsd:annotation>
> <xsd:appinfo>
> <resourcebundle
> name="org.opencms.frontend.templateone.modules.workplace"/>
> <layouts>
> <layout element="Photo"
> widget="ImageGalleryWidget" />
> </layouts>
> <mappings>
> <mapping element="Priority"
> mapto="property:collector.priority" />
> </mappings>
> </xsd:appinfo>
> </xsd:annotation>
>
> Regards
>
> Huy
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Marc Schlegel
> Sent: Saturday, May 10, 2008 8:30 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] cms:contentload - date created needed instead of
> datemodified
>
> Hello Everyone
>
> I am having a problem with a contentload-tag because it is loading the
> elements according to their modified date (so´, the last modified is the
> first in the list) but I need to have the last created element to be the
> first one
>
> I am using the "allInFolderDateReleasedDesc" collector because I thought
> this one provides this functionality. How can I achieve this? If I need
> to create my own collector, how can I do this (and use it in the tag)?
>
> best regards
> -- Marc
>
More information about the opencms-dev
mailing list