Forum
Perch If Else not working
I struggling to get this working, am I doing something wrong? I've create a really simple example from the perch website but still cant get it to work.
When I add the name it displays Author unknown and when I remove the name it displays nothing.
<perch:if exists="name">
<p><perch:content id="name" type="text" label="Name"></p>
<perch:else>
Author unknown
</perch:if>
Please post your Diagnostics Report.
Sorry, here it is
Does your Perch content tag need to be self-closed?
E.g
<perch:content id="name" type="text" label="Name" />
(The example in the docs is written for the latest version of Perch which doesn't need self-closing tags)
That was part of the problem, thanks for that.
Still not working correctly though, it now displays either nothing or both name and Author unknown.
I've just updated to 3.1.1 and its all working now, thanks for your help.