lesaff / statamic-useragent

User Agent addon for Statamic V2.x
4 stars 0 forks source link

useragent returns correct values, but they don't work in conditional statements #5

Closed fitzage closed 5 years ago

fitzage commented 5 years ago

{{ useragent:is_mobile }} and {{ useragent:is_desktop }} return true/false correctly.

However, I can't seem to find a way to use these in conditional statements. {{ if useragent:is_desktop }} does not work as expected.

rrelmy commented 5 years ago

Antlers has a different way to use tags inside if conditions, check Conditions on Tags vs Variables

So it would be

{{ if { useragent:is_mobile } }}