Jump to content

Date Field in Pages: Only display if there's a value


Meddysong

Recommended Posts

I have a Pages database which contains a date field. This isn't a mandatory field, since I'd like to leave it blank most of the time. Unfortunately, I wasn't aware of the following effect:

time.thumb.jpg.80bc18a7134da01a5c1bb33cf

Is there some clever trick I can apply so that if the field is left blank, nothing appears?

Link to comment
Share on other sites

Hi @Ralf H. , I have a similar field with following code written in Custom . Even though there is no if statement, it only displays when a value is set. Seems it is the default behaviour

<span class="ipsBadge ipsPos_center" style="background-color:#F3AF48"><a href="http://www.sahibinden.com/{$value}" target="_blank">SAHİBİNDEN</a></span>

 

Link to comment
Share on other sites

In the Custom section

{{if $formValue}}
<span class="ipsBadge ipsBadge_style6">{$value}</span>
{{endif}}

 

​Does this work in IP.Content? I haven't upgraded yet but need this. Thanks!

Edit: My issue is if there is no data and no field name displayed, it shows a blank line so it messes up formatting.

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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