Stefanowitsch Posted May 22, 2023 Share Posted May 22, 2023 Hi have a general question if this would be possible: I have a page that contains a repeater. This repeater holds an image and a cite for each repeater item. On the page itself all repeater items (= all cites) should be visible in a carousel. But on other pages I would like to select a specific single (!) cite from that repeater to be shown. This cite should be selectable from a list, not just hard coded as a ProcessWire selector with the ID of the repeater item... I know that this could be achieved with a page reference field. But in that case I can't make use of the repeater field but instead have to create a subpage for each cite I want to add. The repeater solution seems to be more straight forward. Link to comment Share on other sites More sharing options...
bernhard Posted May 22, 2023 Share Posted May 22, 2023 On 5/22/2023 at 8:49 AM, Stefanowitsch said: I know that this could be achieved with a page reference field. But in that case I can't make use of the repeater field but instead have to create a subpage for each cite I want to add. Expand I don't think that this is true ? Repeater items are just regular PW pages. They are hidden in the page tree somewhere under the admin page. It should then be possible to create a page reference field with a selector like "parent=123,include=all" Where 123 is the id of the page that holds your repeater items. Not sure if the include=all is necessary, just try it without. 2 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted May 22, 2023 Author Share Posted May 22, 2023 On 5/22/2023 at 9:37 AM, bernhard said: I don't think that this is true ? Repeater items are just regular PW pages. They are hidden in the page tree somewhere under the admin page. It should then be possible to create a page reference field with a selector like "parent=123,include=all" Where 123 is the id of the page that holds your repeater items. Not sure if the include=all is necessary, just try it without. Expand Wow, it does indeed work! All you have to to is 1. Create a page reference field 2. Select the parent page in the field settings (which is the repeater page in that case, hidden under the admin site in the page tree!) 3. Now you can select the repeater items from there like a page reference The only drawback is that this list shows the programmatic created names that are used for the repeater item pages by the system. THIS can be solved by changing the label in the field settings: Link to comment Share on other sites More sharing options...
bernhard Posted May 22, 2023 Share Posted May 22, 2023 Just hook into the page list label ? https://processwire.com/talk/topic/26610-custom-page-list-label/?do=findComment&comment=220584 2 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted May 22, 2023 Author Share Posted May 22, 2023 On 5/22/2023 at 12:40 PM, bernhard said: Just hook into the page list label ? https://processwire.com/talk/topic/26610-custom-page-list-label/?do=findComment&comment=220584 Expand Thanks! I found out you can change the label text for the page reference field in the field settings itself. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now