Forum
If Exists problem
Hi,
I can't figure out why the following If Exists code isn't working.
<perch:if exists id="portcustname">
<section class="content2 sections">
<div class="container">
<div class="row">
<div class="span12">
<h2>What the customer said</h2>
<perch:content id="portquote" type="textarea" html="true" editor="ckeditor" label="Customer Quote" help="Text for the Customer quote section" />
<p><perch:content id="portcustname" type="text" label="Customer Name and Location" help="enter as 'J. Bloggs, Chandlers Ford, Hampshire' etc" /></p>
</div><!--row end -->
</div>
</div>
</section>
</perch:if>
I am still seeing the whole section on the web page even though the portcustname is empty.
Any clues?
It isn't working because you've made up your own syntax :)
See the documentation and top example here: https://docs.grabaperch.com/docs/templates/conditionals/if/
Should be:
:D Doh! I've used if exist many times before, how did I not spot that. I shouldn't code late at night.