Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted July 28, 20168 yr 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'.
July 28, 20168 yr 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.)
Archived
This topic is now archived and is closed to further replies.