Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I would like to rewrite the output of a Taxonomy term field. In particular, to add a class to the html "a" tag. So i used:
<a href="/taxonomy/term/[term:tid]" class="customclass" id="customid">[node:field_name]</a>
When I add this field with this particular formatter to a panel wich is a Node page (a rewrite of the classic Article content type), [node:field_name] is displayed correctly, but [term:tid] doesn't appear.
Any hint?
Thank you in advance
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commented[term:tid]
would only work if you where rendering your formatter on a field being displayed on a Taxonomy term. You are after the value of the Taxonomy term field, which would be something more like:[node:field_term]
or whatever your field is called.Although, that likely doesn't work properly either due to the issue with Field tokens in D7; #1511830: Fix Token engine.