Hello Everyone,
Does anyone know of a way to set default values on a new node once an entity reference field has been selected using data from the entity referenced?
Here's the situation: I'm building a site for cycling club and they have Ride Events which we have set up as one content type. After a Ride Event is completed, a Ride Report needs to be created and that content type uses Entity Reference to be associated with the correct Ride Event.
Ride Reports have a lot of the same data fields as Ride Events, just these are the actual values versus what was planned, so I would like to set the default values for Ride Report Fields based on data taken from the corresponding Ride Event.
Hope that makes sense. Thanks for any help in advance because this is making my brain hurt!
All the Best, Steve Wickham Wickwood Marketing P 518-464-6788 F 518-452-6899 (please call first) C 518-951-0656 steve@wickwoodonline.com
Ride Reports have a lot of the same data fields as Ride Events, just these are the actual values versus what was planned, so I would like to set the default values for Ride Report Fields based on data taken from the corresponding Ride Event.
Can't this be done using a hook_node_prepare in your module? (http://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook...)
Thanks Anoop
|-- | Zyxware Technologies | http://www.zyxware.com |-- | Be the change you wish to see in the world, M. K. Gandhi |--
I don't know Anoop. I haven't written a module for this, I'm trying to figure out first if it can be done without a custom module.
If I do end up needing a custom module, I'll look into it.
Thanks, Steve
On Fri, Mar 29, 2013 at 2:19 AM, Anoop John anoop.john@zyxware.com wrote:
Ride Reports have a lot of the same data fields as Ride Events, just
these
are the actual values versus what was planned, so I would like to set the default values for Ride Report Fields based on data taken from the corresponding Ride Event.
Can't this be done using a hook_node_prepare in your module? ( http://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook... )
Thanks Anoop
|-- | Zyxware Technologies | http://www.zyxware.com |-- | Be the change you wish to see in the world, M. K. Gandhi |-- -- [ Drupal support list | http://lists.drupal.org/ ]