Skip to content
Grav 2.0 is officially stable. Read the announcement →

Muut Archive Legend

@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation

Badges

✏️ First Post 💬 Conversation Starter ❤️ Well Liked

Recent posts

  • Display 3 random blog items · 10 years ago

    Just wondering. Did you get the display of 3 random articles to work? If so, is there some place I could look at it? I'm wrestling with the same problem myself, trying to surface and present one rando

  • Display 3 random blog items · 12 years ago

    Good call!

  • Display 3 random blog items · 12 years ago

    Collection has also other useful functions like: collection.nth(5) collection.shuffle() collection.slice(0, 3) collection.append(second_collection) So in this case I would just use: {% set recent_art

  • Display 3 random blog items · 12 years ago

    it's not the same thing, but it can be done with a collection. Collections support sorting and ordering. something like: {% set recent_articles = page.find('/blog').collection.toArray|split(0,3) %} U

  • Display 3 random blog items · 12 years ago

    Is there a similar method to get the 3 most recent articles in a partial?

  • Display 3 random blog items · 12 years ago

    Wow thanks! Didn't know you could give a value to random(), super easy!

  • Display 3 random blog items · 12 years ago

    Ok, this is even easier than I originally thought :) {% set random_articles = taxonomy.findTaxonomy({'category':'blog'}).random(3) %} I had forgotten, so had to dig into the code. The trick was to lo

  • Display 3 random blog items · 12 years ago

    Thanks for the fast reply! I was experimenting with taxonomy.find however I can't seem to randomize it. I'm probably doing the randomize wrong. I used this for testing: {% set random_articles = taxon

  • Display 3 random blog items · 12 years ago

    Use taxonomy.find or page.parent.collection to get the list of pages. Then randomize filter to shuffle it. Then slice filter to shorten the list to length. Sorry can't really type the code on my iP

  • Display 3 random blog items · 12 years ago

    Is there an easy way to get a collection of three random blog items inside a partial without a plugin?