- Issue created by @AlfTheCat
- 🇩🇪Germany marcus_johansson
So I can replicate this, is it an entity references fields entity that does not show up or how would I replicate this.
Currently I do see the author of a node for instance when using tokens.
- Assigned to marcus_johansson
- 🇹🇷Turkey orkut murat yılmaz Istanbul
It could be nice to add Entity API → as a dependency. Also, there is a great feature ✨ Consistent tokens support across all entities and fields Needs work , which will be added to token → module soon.
- 🇩🇪Germany marcus_johansson
Thanks for reporting the missing feature, but I am still not able to understand what is missing :)
Do you actually even need Entity API for Tokens to work in D8+? The added feature for Token will be great for sure.
Currently I have tested entity references and other fields and it seems to work. To be able to use the Tokens in the AI Interpolator you need to:
- Download and Install the Token module
- Under certain fields like OpenAI Text to Text for instance, you can choose Advanced Mode and use Tokens to prompt.
- Note - Advanced mode is not available on all rules
Is there some place where this fails or where I misunderstood what is missing?
If you mean something like Advanced Entity Tokens → that should also work already with that module, but I'm working on an interpolator plugin to make this easier with dynamic entity injection from autocomplete fields.
What is also missing currently for the Token module is some way to do iteration. I'm trying to figure out that at the moment. So if you use the SERP module for instance and generate 10 links from a search word and you want to run a complex prompt on each of those separately, its not possible at the moment.
- 🇹ðŸ‡Thailand AlfTheCat
Hi Marcus, I'm experiencing this on taxonomy terms. I haven't checked nodes, I didn't think to check token support there.
The example was just a general example. My specific case relates to taxonomy terms and I'm on Drupal 10.1.5.
- 🇹🇷Turkey orkut murat yılmaz Istanbul
@Marcus, for using more tokens from different entities, it would be nice to have Entity API installed. As said on the module description:
It ships with the Entity tokens module which makes sure there are tokens for most entity properties and fields, i.e. it provides token replacements for all entity properties (or fields) that have no tokens and are known to the entity module (read about the entity property info API below).
- b2fdc88f committed on main
Issue #3396303: Entity specific token support
- b2fdc88f committed on main
- 🇩🇪Germany marcus_johansson
@AlfTheCat - Thank you, I could replicate this. I have pushed a change that would fix this to main branch and it will be in alpha4.
For some reason the keys uses to load the Token trees do not match the entity type data names, for taxonomy_term (its term).
I have also tested blocks, contacts, nodes and a custom entity.
- 🇩🇪Germany marcus_johansson
@Orkut Murat Yılmaz - Thank you for clarification, but I can only see that module available in Drupal 7 version of Entity API. As far as I could see this is built into Token module in Drupal 8+. Could you verify that its the same, so I am not missing something?
- 🇹🇷Turkey orkut murat yılmaz Istanbul
@Marcus, I've uninstalled Entity API and re-installed it again, the tokens are not effected. Sorry for misleading:)
- 🇹ðŸ‡Thailand AlfTheCat
Hi Marcus, awesome! I'll be back to work in a few hours and can't wait to jump in again.
- Status changed to Needs review
about 1 year ago 1:56pm 30 October 2023 - 🇹ðŸ‡Thailand AlfTheCat
Tokens are working well now for taxonomy terms. Thanks for the fix!
- Status changed to Fixed
11 months ago 12:20pm 19 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.