Forum

Thread tagged as: Question

Conditionals inside perch:before tags

I'm trying to put a conditional inside some <perch:before> tags but it's breaking things… Here's the code:

<perch:content id="workshop" type="checkbox" label="Workshop?" value="workshop" suppress="true" />

<perch:repeater id="contents" label="Contents" scope-parent="true">
  <perch:before>
    <perch:if value="{parent.workshop}" eq="workshop">
      <p>The workshop includes:</p>
    <perch:else />
      <p>Sessions might cover:</p>
    </perch:if>
    <ul>
  </perch:before>
    <li><perch:content type="text" id="item" label="Item" size="xl" /></li>
  <perch:after>
    </ul>
  </perch:after>
</perch:repeater>

Am I trying to do something that's not possible?

Thanks for keeping me right :)

SUMMARY INFORMATION

Perch: 2.8.32, PHP: 5.6.25, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /cms
PERCH_PATH: /Users/TemperTemper/Sites/voiceintheroom.com/web/cms
PERCH_CORE: /Users/TemperTemper/Sites/voiceintheroom.com/web/cms/core
PERCH_RESFILEPATH: /Users/TemperTemper/Sites/voiceintheroom.com/web/cms/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: voiceintheroom.local
DOCUMENT_ROOT: /Users/TemperTemper/Sites/voiceintheroom.com/web
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Martin Underhill

Martin Underhill 5 points

  • 5 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

<perch:before> 
<perch:if id="parent.workshop" value="workshop">

Thanks Duncan! That works a treat :)