New answers tagged tokens
3
votes
How to prepopulate the body field with the body of another node
If you add the template node ID as URL query parameter
/node/add/product?template=123
this code adds the body content of the template:
mymodule.module:
use Drupal\node\Entity\Node;
/**
* Implements ...
- 93.7k
Top 50 recent answers are included
Related Tags
tokens × 6857 × 217
8 × 94
views × 89
entities × 85
webforms × 75
rules × 71
path-aliases × 55
nodes × 44
users × 43
emails × 26
commerce × 23
files × 22
theming × 20
6 × 18
media × 18
navigation × 18
meta-tags × 18
taxonomy-terms × 17
forms × 14
datetime × 14
hooks × 13
uri × 11
display-suite × 10
javascript × 9