0

I have a problem - I can not properly conclude the list of entries.

Total output last 3 records. Each entry must be a separate template. How can this be implemented?

  • I'm not sure I'm following... you want to output the last 3 entries by date created regardless of the section? – Brad Bell Dec 24 '15 at 16:46
  • no. sorry for bad english, i use google translate :) 1 channel, name - news. output 3 last entries. should be like this - imgur.com/fZtjfhl – Good Santa Dec 24 '15 at 22:41
2

If I'm following you correctly, I think what you're looking for is something like this:

{% set entries = craft.entries.section('news').limit(3).find() %}

<ul>
    {% for entry in entries %}
        <li>{{entry.postDate }} - {{ entry.title }}
    {% endfor %}
</ul>

By default, Craft will order results by the date created in descending order, so that query will get you the last 3 entries in the news section and display them.

  • 1
    No. Sorry for bad english. I found solution - {{ cycle(['style1', 'alt style2', 'style3', ], loop.index0)|raw }} – Good Santa Dec 27 '15 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.