Jump to content

Page reference field selection based on another field


Recommended Posts

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

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.

ss-protable-view.jpg

Link to comment
Share on other sites

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

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):

2017-06-05_144801.png.27d3434b08f6dc3853531aa56917bd81.png

dependency.gif.6bdacd7fa721b000b64498bb166721ad.gif

  • Like 1
Link to comment
Share on other sites

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. 

ss.jpg.e3add5ece54e8f214a2b1c21819e01f7.jpg

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.

  • Like 1
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...