Can this prepopulate a node add entity ref field with current node id

Created on 24 May 2023, over 1 year ago
Updated 1 June 2023, over 1 year ago

I have a node add link to a content type with an entity reference field that i would like prepopulated with the nid of the current viewed node. The viewed node changes. Can I achieve that with this module? I have not found any documentation or examples for this scenario, so I would like confirmation it can be done before I spend any more time researching and testing please.

Using this example from the module page for replacing an entity reference field value, can you confirm that the [field_entity_reference] token would be the machine name of the ER field that we're trying to prepop? If so, it looks like I need to replace the [target_id]=123 token with the current node id. I don't see that in the list of available tokens. The end result would be something like so: [target_id]=[id]? id would be the id of the current page.

Example:
http://www.example.com/node/add/page?edit[field_entity_reference][widget...

Thanks for your time and thoughts.

πŸ’¬ Support request
Status

Active

Version

2.4

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States guymandude

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024