Jump to content

Repeater problem: labels


theoretic
 Share

Recommended Posts

Hi friends! And thanks for Processwire )

It appears I've found an interesting issue concerning repeaters. I have a repeater called details holding a filled called colors which is a page reference. The code for retrieving pages for colors field is stored in a php hook. It's important that this hook retrieves the pages which are actually repeater items stored inside some other pages (let's call them "holder pages"). This works, but there's a problem whith the colors field value labels. I use the following format:

{parent.title} {title}

I supposed that {parent.title} should be retrieved the page holding the colors repeater items. Wrong guess! This {parent.title} is actually retrieved from the dedicated repeater page title inside the "admin" entry in the pages tree. Let's take a look at what I'm talking about:

image.png.2b0e1edde35efcc9d5c279c9593dc507.png

Could be acceptable... but there's something strange with the titles of repeater pages (skytex, skytex-1 etc). It appears that:

  • Their TITLES are copies of the NAMES of the corresponding "holder pages";
  • When a "holder page" title or name is changed, there's NO CHANGE is the title of the corresponding repeater page.

I tried to rename some of repeater pages manually, giving them the same titles as "holder pages" have. It works but it requires some time and effort. And, in plus, I don't see the logic behind. Why should repeater pages have the titles different from the correspondent "holder pages"? Why there's no change in that titles if the titles of the "holder pages" change? Not a bug report, rather suggestion. I understand that this is a rare case... but if this could be made easier, why not? 😉

Edited by theoretic
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...