Chris Falkenstein Posted June 2, 2017 Share Posted June 2, 2017 Hello. I'm interested in using two page reference fields. The user will select a single page from one page reference field. I'd like the second page reference field to base its values off of the value that was selected in the first page reference field. I'm interested in predefining product attribute labels and product attribute values (e.g. size, small...). So size would be a page, small, medium, large would be children pages of the size page. The user would select the size page from a page reference field, the second page reference field would select the children pages of the size page. Those selections, in this case, would be the small, medium, and large pages. Is that possible or crazy talk? I need this to be dynamic. I'm not interested in setting up logic manually, because I want the client to be able to add new attributes and values on their own. Link to comment Share on other sites More sharing options...
Peter Knight Posted June 2, 2017 Share Posted June 2, 2017 Hey @Chris Falkenstein i recall an extra that does exactly that released about 2 years ago. Did you look in the Modules directory? Link to comment Share on other sites More sharing options...
Chris Falkenstein Posted June 2, 2017 Author Share Posted June 2, 2017 Thanks for the reply. I found a couple contenders. I'll have to give them a go. http://modules.processwire.com/modules/fieldtype-select-relation/ http://modules.processwire.com/modules/custom-inputfield-dependencies/ Link to comment Share on other sites More sharing options...
Robin S Posted June 2, 2017 Share Posted June 2, 2017 @Chris Falkenstein, if I understand right you are looking for the "dependent selects" feature. I covered what I know about it here: 2 Link to comment Share on other sites More sharing options...
Chris Falkenstein Posted June 3, 2017 Author Share Posted June 3, 2017 Thanks. I'll explore this further. Link to comment Share on other sites More sharing options...
Chris Falkenstein Posted June 4, 2017 Author Share Posted June 4, 2017 Robin, Would this Ajax feature work if the page reference fields were in a Profields Table field? Take a look at the attached. This doesn't seem to work. Any help? Just to be clear, I'm looking to set up 2 select fields in a table row. One column will select a page. The other column will select the children of that page. Link to comment Share on other sites More sharing options...
Chris Falkenstein Posted June 4, 2017 Author Share Posted June 4, 2017 Hmmm... I can't even get to this work when I ditch the idea of using the fields in a profield table. I just have two page reference fields on a page - one targets a group of pages and allows the use to select one of 'em. the other page reference field should target the children of the page selected in the first page reference field and allow them to select multiple. Of course the first page reference field works fine (nothing special there), but the other doesn't seem to do anything based on the selection. Drat. I'm using a select on one and a asmselect on the other. both fields are using the 'selector string' option for defining the target pages. Any other vital step I'm missing? Thanks for your time. Link to comment Share on other sites More sharing options...
Robin S Posted June 5, 2017 Share Posted June 5, 2017 On 4/06/2017 at 0:10 PM, Chris Falkenstein said: Would this Ajax feature work if the page reference fields were in a Profields Table field? I'd be surprised if it worked with Profields Table as that is quite different from a normal Page Reference field. The relevant JS is here if you want to explore how it works. You could make a request for dependent selects in the Profields Table forum and see what Ryan says. It would be a nice feature. On 4/06/2017 at 1:21 PM, Chris Falkenstein said: Hmmm... I can't even get to this work when I ditch the idea of using the fields in a profield table. It works for me - see below (seems to work with "Custom find" too): 1 Link to comment Share on other sites More sharing options...
Chris Falkenstein Posted June 5, 2017 Author Share Posted June 5, 2017 Thanks for the confirmation. In my case, even if I get this handy dependent selects feature to work, it would not fit the bill of allowing the user to select multiple pre-defined specs and values. Unfortunatley, this would only allow one spec to be defined. I've come up with a elegant solution though. I've opted for the AsmSelect field that targets the spec values (e.g. blue). And Instead of just using the spec page/value as the label I included the page's parent too (color: blue) which makes it clear when viewing the list. See shoot below. And I included a link in the field's notes so they can quickly jump over to the appropriate location if they wish to add a new spec type or spec value. Now that should allow me to safely gather the appropriate data to setup those filters. That's the next bridge I'll be crossing. Thanks again. 1 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