Thread tagged as: Question

Best way to use content multiple times on one page but edit it in one place

Hi guys,

I'm trying to solve the aforementioned problem.

I'd like to have n Chapters each containing n Slides. There are 3 types of slides. With a structure like this to edit the content:

  • Chapter1
    • Slide Type 1
      • Text1
      • Image1
    • Slide Type 2
      • Text2
      • Image2
  • Chapter2

    • and so on

(hope you get the idea behind that bad formatting)

But I need to output the contents in different HTML blocks like so:




Does anyone have a good recipe for this requirement (Edit related content ("slide") in one place but output its content in different places in the HTML )?

Jochen R.

Jochen R. 0 points

  • 5 years ago

Does the video on "Re-using an ID" help?

Yeah, no, I know how to do that. In combination with two levels of repeatable blocks it seems to be impossible to use.

Anyone else stumbled across a similar problem?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You need two templates. One for the 'headers' and one for the body.

Output the region using the headers.

Then output the region using the body.

So I can reuse an ID in different regions? (Edit it in one region but output it in multiple regions)?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Use the same region, but with a different template.

Your bodies might be:


And then you'd modify that to also output the Chapters using the titles-only template:

perch_content_custom('Chapters', [
    'template' => 'titles_only.html',

Works like a charm! Thanks!