- 🇨🇦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)
This module doesn't *directly* impact the view. But it doesn't surprise me that it messes that up. I think it should be possible to fix generically, but might be hard. Putting as postponed since definitely not on my to do list right now but seems like a valid bug as well.
Thanks for the workaround too - 🇦🇺Australia Katy Swain
This appears to be a D8+ Views regression. 🐛 Fix label token replacement for views entity reference arguments Fixed I've been wrestling with it for ages, and have only installed subpathauto five minutes ago, so it's definitely not this module's fault.
I'm just getting back into Drupal after nearly a decade, and this used to be a standard content modelling trope with me; an entity overview page with a whole bunch of child pages following relationships to other entities. I can't imagine how hordes of people aren't screaming over this when something as elementary as 'taxonomy/term/1/articles' can only be re-titled 'Articles About 1' rather than 'Articles About My Cat Desmond'.
- 🇺🇸United States joshuami Portland, OR
I figured out a way to address this without any custom code, but it does require Twig Tweak → and Metatag → .
I appreciated the approach that @DamienMcKenna provided in comment #2, but it only addresses the title provided by the page_title.html.twig template and not the
<title>
element. I was able to get the text for the title of the contextual argument by passing it into Twig Tweaksdrupal_field()
function:{{ drupal_field('title', 'node', arguments.id) }} News
.This works for any entity type that has fields and where you can only get the ID from the contextual argument and not the title/name/label output—such as when you have a Search API Solr view that you are passing a contextual argument ID for an entity referenced field such as "parent group" or "tag".
I hope this helps anyone that might be tripped up on this issue and is looking for a way to set both the view title override and the metatag title element override.
- 🇺🇸United States joshuami Portland, OR
I should add that this is not a subpathauto issue and Fix label token replacement for views entity reference arguments 🐛 Fix label token replacement for views entity reference arguments Fixed fixes the issue for Taxonomy Terms and entity types—I would this it would fix the OG argument example that opened this issue. Search API views with a contextual argument are still not converted correctly. I wonder if we should open a separate issue in that queue and close this.
It feels kinda like https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Plugin/... should be rewritten as SearchAPIEntity.php—as it appears you can pass a taxonomy term and get the correct label, but not any other entity type. 🤔