Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted May 6, 201510 yr 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: Is there some clever trick I can apply so that if the field is left blank, nothing appears?
May 6, 201510 yr In the Custom section{{if $formValue}} <span class="ipsBadge ipsBadge_style6">{$value}</span> {{endif}}
May 6, 201510 yr Author 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!
May 6, 201510 yr 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>
May 7, 201510 yr 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.
May 7, 201510 yr In an IP.Content Template it's:<if test="$data['record']['field_XXX_value']"> {$data['record']['field_XXX_value']} </if>
Archived
This topic is now archived and is closed to further replies.