Forum

Thread tagged as: Problem

Blocks content labelled as Item 1, Item 2 etc

I have a blocks template allowing editors to add a range of content and I need them to be editable individually because of the complexity of each one (would be too much for one page). Each item currently appears as Item 1, Item 2 etc which makes it very difficult to figure out which thing you want to open and edit.

I thought I might be able to use the "Item list column IDs" feature and put a generic field at the start of all blocks so the editor can briefly describe each piece of content for reference, but it doesn't work. I add the ID and the column appears with a dash alongside each item.

Here's my blocks template:

<perch:blocks>

<perch:content id="content-description" type="text" label="Content description" required="true" order="1" help="Describe this content in two or three words" />

    <perch:block label="Normal text" type="normal-text">
        <perch:template path="content/blocks/normal_text.html" />
    </perch:block>

    <perch:block label="Quote" type="quote">
        <perch:template path="content/blocks/quote.html" />
    </perch:block>

    <perch:block label="Image full size" type="image-fullsize">
        <perch:template path="content/blocks/image_fullsize.html" />
    </perch:block>

    <perch:block label="Photo gallery" type="photo-gallery">
        <perch:template path="content/blocks/photo-gallery.html" />
    </perch:block>

    <perch:block label="Video gallery" type="video-gallery">
        <perch:template path="content/blocks/video_gallery.html" />
    </perch:block>

    <perch:block label="FAQs" type="faqs">
        <perch:template path="content/blocks/faqs.html" />
    </perch:block>

</perch:blocks>
Stephen Turvey

Stephen Turvey 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Here's what I would do:

  1. Fix the dash in the id="content-description" item
  2. Move id="content-description" out of the blocks region - it can't be there
  3. Add title="true" to id="content-description"

I'm still getting Item 1, Item 2 etc.

I moved the perch:content "content-description" into each of the individual block templates instead, is that what you mean?

I also added title="true" and suppress="true" as I don't want it to appear on my page. Here's an example of one of the individual block templates:

<div class="clear">
    <div class="wrap wrap--medium">
        <perch:content id="text" type="textarea" label="Text" html="true" editor="ckeditor" imagewidth="480" />
    </div>
</div>

<perch:content id="content-description" type="text" label="Content description" required="true" order="1" help="Describe this content in two or three words" title="true" suppress="true"  />
Drew McLellan

Drew McLellan 2638 points
Perch Support

I moved the perch:content "content-description" into each of the individual block templates instead, is that what you mean?

No, I meant move it outside the blocks entirely. The dash in the ID is also still incorrect - IDs can't have dashes.

Got it, thanks.