Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is what i would like to do.
On my taxonomy term page (www.mywebsite.com/taxonomy/term/2) there is a link to add a node (www.mywebsite.com/node/add/article)
The Article content type has an Entity Reference field.
How to prepopulate the Entity Reference field with term 2 after clicking on the link?
Comments
Comment #2
yseki CreditAttribution: yseki as a volunteer and commentedHi TD44,
On Drupal 7 there is a module that I heavily used called Entity reference prepopulate and what it does is exactly what you are asking for. Unfortunately, there is no version for Drupal 8.
I've never tried to achieve it using Business Rules and unfortunately, it's just almost possible.
It's not a hard feature to implement, I'm just with no time this week and the next one to work on it, but I can do it in the second week of September.
I'm moving it to feature request.
If you or someone else has the coding skills to work on it earlier than me, the file to implement this feature is business_rules/src/Plugin/BusinessRulesAction/ChangeFieldInfo.php
Comment #3
TD44 CreditAttribution: TD44 commentedThank you for your answer yuriseki. However i'm using Drupal as builder, i can't start working on this feature :/ I stay tuned.
Comment #4
TD44 CreditAttribution: TD44 commentedWhat's up yuriseki. Did you find the time to add this plugin (Prepopulate module still does not work on my website)
Comment #5
yseki CreditAttribution: yseki as a volunteer and commentedHi TD44,
Please, attach what you've done on this issue to allow me to see what's going on with your code.
Comment #6
rodmarasi CreditAttribution: rodmarasi commenteddoes https://www.drupal.org/project/prepopulate/issues/2668010 link can solve your problem? sorry. never use this module
Comment #7
sketman CreditAttribution: sketman commented@TD44: You can use Prepopulate module for what you need, I have just implemented it in my project. You need to use format in post #50 in link provided by @rodmarasi