- Issue created by @Sharik_2023
- π©πͺGermany jurgenhaas Gottmadingen
The best way to do that is by creating a view to receive all roles and then loop through the list of roles. Examples for that can be found in the ECA Guide under the
#views
tag, see https://ecaguide.org/tags/#views - there are 5 examples that do things like that.As roles are config entities, and not content entities, views don't support them out of the box. But with a module like Configuration Views β that shouldn't be a problem.
- πΊπ¦Ukraine Sharik_2023
Thank you for the response, but can it be done through a condition: "Role of user" or "Compare two scalar values"?
- π©πͺGermany jurgenhaas Gottmadingen
I don't understand the requirement. Originally you asked how you can do something for all available roles. Now you want to just go through all the roles of the current user? Yes, that's also possible, if that's what you're looking for. You can get all roles of a user as a list and loop through them, just like described above. You can find the token with all the roles of a user in the token browser.
- πΊπ¦Ukraine Sharik_2023
Sorry for the imprecise question. The task is to ensure that after the user registers, there is a condition that each role should have a different field value. For example, for 'Jun' - 7 days, for 'Mid' - 9 days.
- π©πͺGermany jurgenhaas Gottmadingen
I don't know what that means. I'm sure you can do all you're looking for. There are all the conditions and actions available to check, get and set values. What exactly are you missing?
- πΊπ¦Ukraine Sharik_2023
Okay, please tell me which token should I write here?
- π©πͺGermany jurgenhaas Gottmadingen
The token, that contains the user entity that you would like to check. If this is about the current user, then you can always use
[user]
. If it's about a different user, you need to load that user entity into token first, and then you use that token instead.Maybe watching some of the videos on how to do certain things with ECA might be helpful. You can find them here: https://tube.tchncs.de/c/eca/videos
- Status changed to Fixed
over 1 year ago 8:45am 2 August 2023 Automatically closed - issue fixed for 2 weeks with no activity.