twerp
I'm new here

return only 10 most recent from a query

Jump to solution

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>

0 Kudos
1 Solution

Accepted Solutions
tklein
I'm new here

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"

View solution in original post

0 Kudos
2 Replies
tklein
I'm new here

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 Kudos

that did it, at least it pointed me in the right direction.

i.e. for the checkbox you have to create a query and within this query you use limit.

what get me stuck in the first, is that i'm used to use the wizzard mode in order to check my query but the wizzard will remove the limit option.

thanks for helping

0 Kudos