Meddysong Posted May 6, 2015 Posted May 6, 2015 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?
opentype Posted May 6, 2015 Posted May 6, 2015 In the Custom section{{if $formValue}} <span class="ipsBadge ipsBadge_style6">{$value}</span> {{endif}}
Meddysong Posted May 6, 2015 Author Posted May 6, 2015 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!
ABGenc Posted May 6, 2015 Posted May 6, 2015 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>
chilihead Posted May 7, 2015 Posted May 7, 2015 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.
opentype Posted May 7, 2015 Posted May 7, 2015 In an IP.Content Template it's:<if test="$data['record']['field_XXX_value']"> {$data['record']['field_XXX_value']} </if>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.