I'm trying to arrange it so that the output order of a Playa field can be controlled by a global variable or radio button channel field (to make it able to be toggled from the listed order to random) but having no success.
When I try using a global variable (carousel-order) with the value set to "random" like this:
{exp:playa:children field="home_carousel" orderby="{carousel-order}"}
It doesn't seem to recognize the global variable. I've also tried using radio buttons to make the switch, like so:
{if carousel_order && carousel_order == "Random"} {exp:playa:children field="home_carousel" orderby="random"} {if:else} {exp:playa:children field="home_carousel"} {/if}
Which actually gives me a parse/syntax error:
Parse error: syntax error, unexpected T_ENDIF in /data/home/rsitka/projects/rsdevwww/system/expressionengine/libraries/Functions.php(679) : eval()'d code on line 241
I've read things like there may be an issue with the order things are parsed but surely someone has needed to do this at some point and run into this issue? Anyone found any workarounds or maybe I'm just missing something obvious?
Thanks!