We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question

Adding a common text area to each Repeater item

Is there a way I can add a shared text area to each repeater item.

Basically I have a repeated item (Slider).

I want each slide to have a common text-area that can also be updated by my client. Rather than having to copy/paste it for each slide, can I create a template that allows them to change only write it once?

It need to be in the page region template and not a 'Shared' region.

James Tedder

James Tedder 0 points

  • 8 months ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you want the same content for each item in the repeater?

Each slide will need a different image and slide heading.

But all the slides in the repeater need to share a text-area with code. (Which needs to be editable in the CMS).

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello James,

You can have a (suppressed) field outside the repeater and you can bring it into the repeater's scope by using the scope-parent attribute:

<perch:content id="desc" type="textarea" label="Shared Description" suppress>

<perch:repeater id="slides" label="Slides" scope-parent>
    <perch:content id="image" type="image" label="Image">
    <perch:content id="parent.desc" type="textarea">    
</perch:repeater>

Docs:

Perfect Thanks guys.