Customization

Simply Random Twig

Sometimes you come across a use case for random and you can't resist. Given an array, you can do this easily with twig's "random()" function. 

{# Example array #}
{% set tagsLeads = ['More on', 'Posts about', 'Filtered to'] %}

{# Sort and grab first #}
{% set title = random(tagsLeads) ~ ' ' ~ entry.title %}
This site and its contents
 © Cody Hopper 2024