Jump to content

Template Syntax Error


Hunter Lyons

Recommended Posts

Posted

I made a custom field call Information Box that is yes/no. In Pages I am using the following expression:

{{if $record->customFieldDisplayByKey('info_box','display') == 1}}
 

{{endif}}

There is content inside the if statement. However, it does not display the content regardless of whether or not I turn the ticker on/off for an article. 

I am using the correct reference to the field and have been trying to get this to work for a few days now. How can I fix this? I am following the advice in the template syntax help guide. 

Posted
8 hours ago, Lyonharted said:

','display')

The value depends on the setting

display.jpg.e75912f55b19f152999a9110a08c62b3.jpg

If you want compare value with 0/1 use the raw

{{if $record->customFieldDisplayByKey('info_box','raw') == 1}}
 

{{endif}}

 

Posted

That worked! Weirdly enough, with == 1, it did not work, but I removed == 1... and for some reason this expression worked:

{{if $record->customFieldDisplayByKey('info_box','raw')}}


{{endif}}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...