When I use a URL path alias pattern like this one: [node:field_my_category:entity:name]
... I would expect the name
field of the taxonomy term (my_category) to be used. But instead the label()
method of that entity seems to be used.
I think that, because in our project we have updated the label()
method for taxonomy terms. It does not return the name
field anymore. Instead it is producing another string representation of the taxonomy term (based on a custom field). And in that scenario the name
field is ignored and our custom field is used in the URL alias.
This behaviour was different in the past. I think with Drupal 9, the actual name
field was used.
The issue seems to be related to a problem that I described in this ticket: https://www.drupal.org/project/drupal/issues/3223302 →
name
token part of the taxonomy term entity.label()
method instead of the name
.
I would suggest to...
entity:name
is returning the content of the name
field of the entity, like it was in Drupal 9. There could be another keyword like entity:label
that is using the label()
method.name
field, like entity:field_name
If the latter already exists, then I must have missed it. I browsed the available tokens in the backend, but I did not find any way to get the name
field of a taxonomy term.
Active
1.10
Tokens