Repeating Regions

Video Transcript

Our team page displays all of the company employees. As the business owner might want to add, remove or reorder the employees at any time we can use a Repeating Region in Perch to give them this flexibility.

Setting up this page should be a familiar job if you have been following these tutorials. We create a template for an employee with all of the fields required and the mark-up that we need.

We then add a Perch Region to the page and select our new template.

Select the Allow Multiple items checkbox when selecting your template. You can also change this setting in Region Options at any time.

I can then start editing.

Add your first employee. Click Save and Add Another and you can add another one.

If you have quite a large template this ‘all on one page’ view can get a bit tiresome. If you go into Region Options you can deselect ‘Edit All on One Page’ and instead you can edit in a list detail mode.

While we are in Region Options here is a little tip. In your template, if you give more than one item a title attribute, these will get joined together when displayed in admin. It’s particularly useful in the list detail mode and when reordering. If you don’t set a title your items will be named Item 1, Item 2 and so on.

In my case I have given name and family name, so a space is the best thing to separate them.

Save this and instead of the long page of content you can view, edit and add items individually.

View your site and see the items appearing.

Add your first employee. Click Save and Add Another and you can add another one. If you look at your page you will see these displayed.

If you have quite a large template this ‘all on one page’ view can get a bit tiresome. If you go into Region Options you can deselect ‘Edit All on One Page’ and instead you can edit in a list detail mode. Save this and instead of the long page of content you can view, edit and add items individually.