Jump to content

Using Custom Find to get a simbling repeater values


rooofl
 Share

Recommended Posts

In a page’s admin interface, I need a select field to be populated with the values of another repeater that exist in the current page. To create such a reference, I tried to use Edit Field > Input > Custom Find, and Selector String. But I struggle to pass the “this page” reference. Ideally, I would like to find `$page->font_style`, `font_styles` being the repeater I want the values from.

What am I missing?

Link to comment
Share on other sites

Thank you for your answer!

38 minutes ago, virtualgadjo said:

to make it eve easier i use the title* field in the repeater elements as pw uses it to make the list

If I understand correctly, you are referring to the Repeater item labels, where I currently have the {title} as value, to show the item’s titles as field name?

39 minutes ago, virtualgadjo said:

then, for your page reference field just choose repeater_yourrepeatername in the template choice, done 🙂

I don’t understand that part, what is the page reference exactly?

Link to comment
Share on other sites

hi again 🙂
actually i'm referring to the field you use in the repeater, whether or not it's the one you use as the item title in the page
image.png.72a36f9e2ccc7da27dc1a522305b9096.png

as it is natively the one pw will use in a page reference field


coming to this page reference it's just the type of field easy to populate with a list of "pages" of your choice, here the repeater elements, thanks to the fact pw create a template for the the repeater elements and a page for each element (bot the most poetic sentence... guilty as charged 😄

image.png.a7650539c1478dac5c0f2d5c8159fafc.png

and, in this field parameters (input tab) you just have to choose your repeater template pw has created on the fly
image.png.a530460a9b46256c3f6df01fcc586d27.png
here, just for the example, my repeater was named... my_repeater 🙂

have a nice day

  • Like 1
Link to comment
Share on other sites

On 1/16/2023 at 1:23 AM, rooofl said:

But I struggle to pass the “this page” reference.

Your selector string will be "id=page.name_of_your_repeater_field, check_access=0". The "check_access=0" is so that it works for non-superusers.

In the example below I'm using a repeater field named "test_repeater".

image.png.9f36c443329ce0ad7b463d206c5fe8d5.png

image.png.ab5475aa3acb2d639c821cc7c8738d97.png

If you repeater doesn't include the title field you'll want to choose something different in the "Label field" setting.

  • Like 2
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...