Forum

Thread tagged as: Question, Problem

Multiple sets of Blocks

Hey,

I've just starting using Blocks (which is awesome!) and I'm trying to include multiple sets of blocks on a page. It's a complicated layout and I have two separate regions within my HTML structure where they're appearing.

It was fine when I had one set but when I added the second it's screwed it up in the admin and front-end.

One set: One set

Two sets: Two sets

My two sets of Block looks like:

<perch:blocks order="3">
    <perch:block type="image-imac-preface" label="Preface iMac image">
        <perch:template path="content/blocks/image_preface_imac.html" />
    </perch:block>
    <perch:block type="image-iphone-white-preface" label="Preface iPhone (White) image">
        <perch:template path="content/blocks/image_preface_iphone_white.html" />
    </perch:block>
    <perch:block type="image-iphone-black-preface" label="Preface iPhone (Black) image">
        <perch:template path="content/blocks/image_preface_iphone_black.html" />
    </perch:block>
</perch:blocks>

<perch:blocks order="5">
    <perch:block type="text" label="Text">
        <perch:template path="content/blocks/text.html" />
    </perch:block>
    <perch:block type="image" label="Feature image">
        <perch:template path="content/blocks/image_full.html" />
    </perch:block>
    <perch:block type="image-imac" label="Feature image iMac">
        <perch:template path="content/blocks/image_full_imac.html" />
    </perch:block>
</perch:blocks>
Richard Wiggins

Richard Wiggins 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

A template can only contain one perch:blocks section.

Bugger. Thanks :)

I would personally love to see multiple perch:blocks tags or some way of sectioning off areas of the page for certain blocks as a feature, It can be quite annoying to workaround this issue when you want to display blocks on two sections of a page.

Josh Burgess said:

I would personally love to see multiple perch:blocks tags or some way of sectioning off areas of the page for certain blocks as a feature, It can be quite annoying to workaround this issue when you want to display blocks on two sections of a page.

Seconding that!

I am trying to call the same block twice in one template and I also can't do that, I would also love to see this feature added. Thanks