Forum
Blocks not working within category template
I have a set of blocks using template includes that works perfectly on a standard page
<section class="fixed-image slide" style="background-image:url('<perch:content type="image" id="image" label="Background Image" width="1920" bucket="Backgrounds" />');">
<div class="container">
<div class="row">
<div class="col-sm-12">
<perch:blocks>
<perch:block type="content" label="Plain text">
<perch:template path="content/blocks/_plaintext.html" />
</perch:block>
<perch:block type="testimonial" label="Testimonial">
<perch:template path="content/blocks/_testimonial.html" />
</perch:block>
<perch:block type="button" label="Contact button">
<perch:template path="content/blocks/_button.html" />
</perch:block>
</perch:blocks>
</div>
</div>
</div>
</section>
When I include the same code on my category template, in the back end, I get the block options but clicking any of them results in the grey bar and no fields for that block.
<perch:before>
<section class="fixed-image slide" style="background-image:url('<perch:content type="image" id="image" label="Background Image" width="1920" bucket="Backgrounds" />');">
<div class="container">
<div class="row">
<div class="col-sm-12">
<perch:blocks>
<perch:block type="content" label="Plain text">
<perch:template path="content/blocks/_plaintext.html" />
</perch:block>
<perch:block type="testimonial" label="Testimonial">
<perch:template path="content/blocks/_testimonial.html" />
</perch:block>
<perch:block type="button" label="Contact button">
<perch:template path="content/blocks/_button.html" />
</perch:block>
</perch:blocks>
</div>
</div>
</div>
</section>
<section>
<div class="container">
<div class="row">
</perch:before>
<div class="col-sm-6 col-md-4 grid-image">
<a href="/hires/<perch:category id="catSlug" type="slug" for="catTitle" />">
<img src="/assets/img/OE-staging-thumb.jpg" alt="" />
<p><perch:category id="catTitle" type="smarttext" label="Title" required="true" /></p>
</a>
<perch:category id="desc" type="textarea" label="Description" editor="markitup" markdown="true" size="s" suppress="true" />
</div>
<perch:after>
</div>
</div>
</section>
</perch:after>
There are no errors in the debug and the template paths all look correct.
Is it because that I have this in the <perch:before>
section?
My Diagnostic report
Perch Runway: 2.8.28, PHP: 7.0.0, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 7e72f9690b1498a1bead7a637c33a831c0d2f655 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.28), assets (2.8.28), categories (2.8.28)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_RESFILEPATH: /Users/Caleb/Git/Beanstalk/oak-events/httpdocs/assets/resources
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/Caleb/Git/Beanstalk/oak-events/httpdocs/perch
PERCH_CORE: /Users/Caleb/Git/Beanstalk/oak-events/httpdocs/perch/core
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: oakevents:8888
DOCUMENT_ROOT: /Users/Caleb/Git/Beanstalk/oak-events/httpdocs
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Yes, you can't use fields within before and after tags.
Thank Rachel. I did not know that.
I'll try a different approach.