Echo a title or a custom field with PyroCMS

106 views Asked by At

What I trying to do is to echo the title if a custom field is empty.

{{ if custom_fields:alternative_title != "" }}
    {{ custom_fields }}{{ alternative_title }}{{ /custom_fields }}
{{ else }}
    {{ title }}
{{ endif }}

This code didn't work.

Thanks

0

There are 0 answers