We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Is there a limit to how many times <perch:if> can be used in a template?
I'm using perch:if extensively to alter the display of a map of the US states. Perch:if exists and perch:if not-exists are used to alter the fill color of the svg for each state and to change what a state links to, as well as changes the title text. It works great, but conks out around Ohio or so and then stops working from there. That sounds suspiciously like a bug on my end but I can't seem to find any. In the source code, </perch:if> statements pop up from about Ohio which causes the map of the remaining states to not display.
Each state follows basically this model:
<perch:if not-exists="OH-centers"> <a xlink:href="/centers/franchise.php"> <perch:else /> <a xlink:href="/centers/ohio.php"> </perch:if> <path id="OH" <perch:if exists="OH-centers"> fill="#51a8ad" <perch:else /> fill="#e7e3e7" </perch:if> d="M731.4,195l-6.1,4.1l-3.9,2.3l-3.4,3.7l-4,3.9l-3.2,0.8l-2.9,0.5l-5.5,2.6l-2.1,0.2l-3.4-3.1 l-5.2,0.6l-2.6-1.5l-2.4-1.4l-4.9,0.7l-10.2,1.6l-7.8,1.2l1.3,14.6l1.8,13.7l2.6,23.4l0.6,4.8l4.1-0.1l2.4-0.8l3.4,1.5l2.1,4.4 l5.1,0l1.9,2.1l1.8-0.1l2.5-1.3l2.5,0.4l2,1.5l1.7-2.1l2.3-1.3l2.1-0.7l0.6,2.7l1.8,1l3.5,2.3l2.2-0.1l1.1-1.1l-0.1-1.4l1.6-1.5 l0.2-5l1-3.9l1.5-1.4l1.5,0.9l0.8,1.2l1.2-0.2l-0.4-2.4l-0.6-0.6v-2.4l1-1.3l2.3-3.4l1.3-1.5l2.1,0.5l2.3-1.6l3.1-3.4l2.3-3.9 l0.2-5.4l0.5-5v-4.7l-1.1-3.1l1-1.5l0.9-1l-1.4-9.8L731.4,195z"/><perch:if exists="OH-centers"><title>Ohio has<br /><perch:content id="OH-centers" type="text" label="Ohio" size="s" maxlength="4" required="false" /> center(s)</title> <perch:else /><title>Franchises available</title> </perch:if> </a>
So that's 2 perch:if exists and 1 perch:if not-exists per state, or roughly 150 such statements for the template. The page loads quickly, but as I mentioned, I start seeing </perch:if> in the source code. Is there a limit to such statements?
Want to reply to this thread?Login with Perch