Forum

Thread tagged as: Question, Problem, Suggestions

Renaming region?

Hi, is there are way to rename regions, or at least the title displayed in perch?

We have a region within a page template that doesn't make sense for all pages; we wish to rename to something more general without losing the content for each page.

e.g. rename

<?php perch_content('news_items'); ?> 

to

<?php perch_content(id='news_items', title='Items'); ?> 

Thanks

James Hazelton

James Hazelton 0 points

  • 7 years ago

I like the idea of this. Sometimes I have had the need for this. [+1]

Drew McLellan

Drew McLellan 2638 points
Perch Support

There isn't a way to do that currently, no.

Ok, is there any other way to go about it that doesn't require having to lose all the content?

Thanks.

Drew McLellan

Drew McLellan 2638 points
Perch Support

At the moment, content regions are identified only by their name. You can't change the name.

When we decide to do this its quite straightforward ... Create a new region underneath the original one in the page source, and reload the page to create the Perch entry. Cut and paste the first region's content to the second region. Temporarily, everything appears twice on the page. Delete the first 'perch_content' from the page source code. Delete the old region from Perch Admin.

Ta, yes unfortunately a manual process, not good for 10's of pages with heavy content, reality none the less for now. Thanks.

Could you change the name with a 'find and replace' in the database. Then change the region name in you page to match?

^ Hmmm, might look into that.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It should go without saying, but that's not supported!

I don't know how much this has changed in two years, but when I looked in the perch DB recently, it looked like all the regions were referenced in the content table by a "Region ID", and not the name itself.

Keeping in mind that it's still probably not supported, this seems to be more feasible now, as all you'd need to do is change the "regionKey" column in the "perch2_content_regions" table.

Or so it seems. I didn't actually try. But I, too, have wanted to change names of regions. Sometimes what you are doing with an existing region evolves over time, and the old name for the region no longer makes sense.

I feel one of the biggest things lacking in Perch currently is tools to make managing the data easier: changing names, migrating content between separate instances of Perch, etc. Understanding that it's not a small thing, and not complaining as I respect the product they've given us. But dang, it's hard to manage these things sometimes. : )

This would be an awesome feature for the next Perch update!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Changing region names is on the roadmap for Perch 2.9.

@james this is now possible since Perch/Runway v3.0 was released today.... woooo hoooo. :)