We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Conditional Global Variables

Nico del Castillo August 11, 2015 by Nico del Castillo

I searched around for a possible answer on this but I'm kind of stumped, I bet I'm missing something.

Trying to achieve this effect:

{{ if segment_1|length == '2' }}
  {{ {segment_1}_global_variable }}
{{ else }}
  {{ _global_variable }}
{{ endif }}

The above doesn't work, but I think it communicates what I'm trying to pull off. That is, trying to insert a couple of characters into a global variable call based on the first segment. Is there a method of altering a global variable call like this?

Answered by Jack McDade!
>>>>>>> Answered <<<<<<<
6 Replies
3 Followers