Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
BN_IT_Support Posted July 28, 2016 Posted July 28, 2016 What's wrong with this please? {{if $record->customFieldDisplayByKey('offer_title')}} <span class='ipsType_light ipsType_reset ipsType_large'> <a href="{$record->container()->url()}" title="Country"> <i class="fa fa-globe" aria-hidden="true"></i> {$record->container()->_title}</a> </span> {{endif}} I'm trying to display a DB field in a DB template only if the field has a value. But this displays all the time irrespective of whether there is anything in 'offer_title'.
opentype Posted July 28, 2016 Posted July 28, 2016 Try the specific template call, like so: {{if $record->customFieldsForDisplay('display')['your_field_name']}} {{endif}} That should work for text fields. (My preferred method is to move the the check into the field settings and check for $formValue. That works for more field types.)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.