Forum

Thread tagged as: Question

Content inside perch:before not rendering

Hi guys,

I'm building a "master" block template that I can re-use across multiple pages, and I need to put repeaters in some of the blocks.

The trouble I'm having is that in this block in particular, the content placed inside the <perch:before></perch:before> tags is not showing up on the front end of the site.

Here's my block template:

<perch:block type="text-images" label="Text (With Four Images)">
    <perch:before>
    <div class="htb_text-image">
        <div class="htb_text-image-main">
            <div class="full-width-container">
                <img src="<perch:content id="text-image" label="Image" type="image" width="500" crop="true"/>" alt="<perch:content id="text-image-alt" type="text" label="Image ALT Tag" />" title="<perch:content id="text-image-alt" />"/>
            </div>
            <div class="text">
                <perch:content type="textarea" textile="true" id="text-image-text" label="Text" markdown="true" editor="markitup" size="m"/>
            </div>
            <div class="image-holder">
                </perch:before>
                <perch:repeater id="image-caption" label="Image with Caption">
                <div class="image-cap-section">
                    <img src="<perch:content type="image" width="400" crop="true" id="im-cap-image" label="Image" />" alt="<perch:content type="text" label="Image ALT Tag" id="image-alt" />" title="<perch:content id="image-alt" />" />
                    <div class="arrow_box">
                        <h3><perch:content id="perch_item_index" type="hidden" />.</h3>
                        <perch:content type="textarea" textile="true" id="image-caption" label="Image Caption" markdown="true" editor="markitup" size="xs"/>
                    </div>
                    <perch:content type="textarea" textile="true" id="text" label="Text" markdown="true" editor="markitup" size="xs"/>
                </div>
                </perch:repeater>
                <perch:after>
            </div>
            <perch:if exists="button-text">
            <a class="htb_button" href="<perch:content id="button-destination" label="Button Link" type="text" />"><perch:content id="button-text" type="text" label="Button Text" /></a>
            </perch:if>
        </div>
    </div>
    </perch:after>
    </perch:block>
Harry Ray

Harry Ray 0 points

  • 4 years ago

Is this block inside a <perch:blocks> tag in your complete template?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the before section intended for the repeater? If so it should be inside the repeater.

Robert Ketter said:

Is this block inside a <perch:blocks> tag in your complete template?

Sure is!

Drew McLellan said:

Is the before section intended for the repeater? If so it should be inside the repeater.

I tried that, however, the solution that I got yesterday for a similar issue didn't solve it that way. The before section is intended to be before the repeater - not part of it.

I've now solved the issue by removing the before and after tags entirely.

Thanks for the help both!