ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Randomize and limit number of categories displayed

January 13, 2011 4:21pm

Subscribe [2]
  • #1 / Jan 13, 2011 4:21pm

    Victoriaz

    19 posts

    Hi

    I was wondering how to make something like this:

    {exp:channel:entries channel="news" limit="3" orderby="random" }
     {title}
    {/exp:channel:entries}

    work with Categories (instead of entries), given that parameters ‘limit’ and ‘orderby’ do not work with categories. If this (below) worked, it would have solved my problem:

    {exp:channel:categories channel="blogs" limit="3" orderby="random"} 
     {category_image}
    {/exp:channel:categories}

    Thanks!

  • #2 / Jan 14, 2011 10:24am

    Ingmar

    29245 posts

    I am afraid there is no way to randomize categories in that way. You’d have to use a custom SQL query to achieve that, I am afraid.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases