Jump to content

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


Meddysong

Recommended Posts

Posted

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?

Posted

Thank you! I was just speeding back here as fast as a man with a cat asleep on his hand can do to type "Oh, I should have something in custom of the form 'if the value is a date, then apply this HTML', shouldn't I?""

Thanks again!

Posted

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>

 

Posted

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.

Archived

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

  • Recently Browsing   0 members

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