I'd like to setup two content types in a parent -> child relationship.
Node A of content type "parent" has custom field:
- (text) Description
Node B of content type "child" has custom fields:
- (text) Description dynamically inherited (referenced) from parent node.
- (reference) to parent node
When the description of Node A changes, Node B automatically reflects this change.
I'd like to achieve this entirely on the backend, no UI or forms needed.
I will be creating the child nodes programmatically.
Topics I've found have danced around what I'm trying to do but lack the details I need to execute it. inheriting fields from a base content type
I have experience with Drupal 6 & 7 but am new to Drupal 8's entity apis.
A detailed explanation or example of how to achieve this would be greatly appreciated.
One possible solution:
Store the parent node's updated date in the child node. Upon loading the child node, lookup the parent node's updated date, if it differs, copy the parent's field value to the child.
The parent node will not be updated frequently.