Search code examples
expressionengine

Expression Engine - How do I randomly display one of the last seven entries?


I would like to randomly display one of the last seven entries from a particular channel. I tried using offset="" but that happens to be exactly the opposite of what I need. I also considered using a date option: only show entries after a certain date, but that would only last for a while before it had to be modified.

Any serious suggestions will be seriously considered.

Thanks.


Solution

  • There's really no great way to do this natively with expressionengine.

    Check out the AB entry ids addon. here's a specific example that should be what you're looking for: http://www.addonbakery.com/docs/ab-entry-ids.html

    Just add orderby="random" to the nested channel entries tag pair and limit the entry ids query to 7.

    http://devot-ee.com/add-ons/ab-entry-ids