Jump to content

Custom PHP code to populate select option values in admin


waheed
 Share

Recommended Posts

Custom PHP code is available for use in PageReference field type. Is it possible to use custom php to generate the values for a Select Options FieldType?? 

What I'm to trying to achieve is to generate values for a options field from values for repeater in a grand parent's page (parent of parent page).

Link to comment
Share on other sites

7 minutes ago, Sérgio Jardim said:

Oh yeah! See:

 

That post was NOT for modifying the field options but to save an options selected in his form. Probably front-end stuff.

What I'm looking for is a solution to the backend to dynamically set/modify selectable options based on field values from grand-parent page.

I came across something close. https://github.com/BitPoet/FieldtypeDropdownDynamic

But it has not been updated for 2 years and my lack of ProcessWire knowledge is keeping me from updating it.

Coming from the WordPress world, PW is very different (in both good/bad ways). In WP we store custom field configurations in php, but here its stored in DB tables.

Link to comment
Share on other sites

Didn't have time to test either of these, but you should have a look here:

https://modules.processwire.com/modules/fieldtype-select-ext-option/
https://modules.processwire.com/modules/fieldtype-select-relation/ 
https://modules.processwire.com/modules/process-dynamic-selects/

Maybe one of those does exactly what you want, or at least can be tweaked easily...

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...