Hey,
I am trying to use a conditional field with a node reference module - and the nodes that can be referenced will continuously grow, this the multi-select list of nodes for use is not able to keep up with these newly-added nodes. Additionally, I'm looking to have the form trigger based on whether or not one of these nodes has a specific attribute, in this case, a location.
As such, I figure this would have to be performed via php. For example:
Let's say, a user selects a node from the reference field of node id 50:
$nid = 50;
$node = node_load($nid);
if ($node->location){
//fire trigger
return TRUE;
}else {
//do not fire trigger
return FALSE;
}
This is probably a little oversimplified I may run it through some more checks but it gives you the idea of the requirement. Is something like this possible? Is it possible to run the check via some AHAH callback and dynamically run the code to return the value to trigger the form? If so, is something like this planned/possible for implementation?
If so, how much work do you think it would be to do so and is there a timetable on when it might be implemented?
If not, can you suggest some places I could start looking into so I can see if I can write the integration myself or hire a developer to do so?
Thanks!
Comments
Comment #1
peterpoe commentedThe next version of Conditional Fields (version 3) will support this kind of functionality. It's 80% ready, but still not ready for a public release. In the next 3 weeks or so I think I will be able to finish it and post a first dev on drupal. I cannot guarantee a release date yet, but check for updates soon. Any sponsorship would be very welcome, of course.
Comment #2
rc2020 commentedplease email me - i got a few ideas. thanks!
Comment #3
mstrelan commentedsubscribe
Comment #4
Max_Headroom commented+1
Any update on this?
Comment #5
YK85 commentedim super interested in this feature
Comment #6
compsyguy commented+1
Comment #7
compsyguy commentedJust out of curiosity, would it be possible to use a computed field as the triggering field to generate the php? I know that conditional fields doesn't have native support for computed field, but has anyone tried adding it yet?
http://drupal.org/project/computed_field
Comment #8
roball commentedComment #9
peterpoe commentedWould be great, but will have to wait for this:
#884268: AJAX loading of dependent fields
Comment #10
liquidcms commentedalso interested in php coded dependent fields. project i am currently on could help fund this work.
Comment #11
dqdThanks for the report and all the efforts in here. But due to inactivity in this issue for some years and because of the upcoming EOL of Drupal 7, I will close this issue on the way by cleaning up the issue queue.
Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported to help others on this outdated version.
If you think this issue or missing feature should be addressed in a newer Drupal core 8 and above compatible version of this project, then please file a new issue to the latest dev.