return only 10 most recent from a query
Author: twerp
Publication Date: 9/10/2013 9:10
Hi,
I'm trying to use a cms_checkbox with cms_include_option to give my customer a choice what he wants to display.
But it should be only most recent 10 entries to be displayed.
In SQL I would order by date and restrict the result with ROWNUM or LIMIT or somethig alike.
Do we have something similar at hand in FirstSpirit 4.2?
Or can this be achieved any other way?
Thanks
Volker
<CMS_INPUT_CHECKBOX name="cs_news_one" useLanguages="no">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.subtitle_EN +" Date: "+#item.date.format("dd.MM.yyyy")</LABEL>
</LABELS>
<QUERY>
…..
</QUERY>
<TABLE>Databases.newsletter</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="Newsletter"/>
</LANGINFOS>
</CMS_INPUT_CHECKBOX>
Tags: cms_include_options, query
-
Author: tklein - 9/10/2013 13:54
Hi Volker,
please try this:
<QUERY entityType="BEZEICHNER" limit="10">
.....
<ORDERCRITERIA attribute="date" descending="0" />
<QUERY>
For more information take a look to ContentSelect. Especially the part below "Query part"
0
Please sign in to leave a comment.
Comments
1 comment