Jump to content

{{if}} usage to check value


iJeff

Recommended Posts

Posted

Hi, I have field in pages, which upload the logo (image), however it's only for pro members, for other members it's now showing missing image icon, i am trying to use the if condition
but it's not working out as below., can you please help

{{if $value }}
<img src='{$value}' width='100'/>
{{else}}
<!-- no -->
{{endif}}


 

Screen Shot 2018-08-05 at 7.10.29 PM.png

Posted
3 minutes ago, opentype said:

Pages fields have individual permission. You should be able to just change those without the need for any custom code. 

I have uploaded the screenshot to explain the problem. where logo is not uploaded it's showing missing image icon.

Posted
3 minutes ago, opentype said:

Check for $formValue, not $value. The latter is a prepared output, which can contain stuff even for empty records. 

{{if $formValue }}
<br><img src='{$value}' width='100'/>
{{else}}
{{endif}}

it did the trick thanks.

Archived

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

  • Recently Browsing   0 members

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