- Issue created by @guymandude
- π©πͺGermany jurgenhaas Gottmadingen
What's the event, you're starting with? Could well be that the event you chose is not being dispatched on cached pages.
- πΊπΈUnited States guymandude
I'm using a Viewed Content Entity as a trigger.
- π©πͺGermany jurgenhaas Gottmadingen
OK, that's certainly cached and Drupal will not dispatch that if not really needed. You may want to switch to something like Controller found to handle request and then load the entity that's being viewed with the Token: load route parameter action.
- πΊπΈUnited States guymandude
Thanks for the prompt feedback. Can you offer a suggestion for a non-coder please? Are there some canned events that fit the bill by chance?
- π©πͺGermany jurgenhaas Gottmadingen
Can you offer a suggestion for a non-coder please?
The 2 links in my previous comment do the job. And a sample, that does something similar can be downloaded from Route test.
- πΊπΈUnited States guymandude
Thanks again. I imported the example you have here and it works as noted. However it's not clear how to find the value of the token name. The example uses "mynode" for that token name, but it does not appear to be an arbitrary name. I tried changing the value to something else and the message no longer appears on screen when viewing an article.
From the Load Route Parameter instructions:
Name of token
The name of the token, the parameter value gets stored into.I used Devel to see if I could find a token called mynode but I could not. Does mynode have special significance to Drupal or ECA?
- π©πͺGermany jurgenhaas Gottmadingen
The name of the token there is fully your choice. It is a name you define yourself, it's the place where the value is being stored and you can refer to that value later with the token syntax, e.g.
[mynode]
or whatever you decide you want to call that. More details about tokens can be found at Tokens - Status changed to Postponed: needs info
11 months ago 2:18pm 22 December 2023 - Status changed to Closed: outdated
8 months ago 1:59pm 2 April 2024