I've got a view of nodes, displayed as fields. As each node may have references to multiple terms/tags, I would like to show all these tags.

When I use field "term_node_tid", then I get the multiple values properly displayed in one row separated by commas. But instead of the readable term, I need the term-IDs.

So I set up another field using "tid", but now only the ID of the first term is shown. There's no multiple value field setting, where I could tweak things. Any help much appreciated.

This question has an open bounty worth +50 reputation from Madam Adam ending in 3 days.

This question has not received enough attention.

up vote 1 down vote accepted

Change field Formatter

If you're showing the actual Content field you can change the Formatter. Instead of using Label use Entity ID under Formatter.

This will output Term IDs instead of term names, and all the Multi-valued settings will apply the same way as for the names output.

Rewrite results with TID replacement token

Another way or changing the field output in D8 views (if the Formatter option isn't available for example) is to use the Rewrite results > Override the output of this field with custom text and enter the token for the TID in there. You can look up the correct token pattern under Replacement patterns below the Text area.

That is also how you would get the TID to display instead of the name if you use the field Content: All taxonomy terms.

  • neither the formatter option is available, nor rewriting like {{ tid }} reveals all values … I can't believe this standard task isn't a no-brainer. Maybe I am missing something? – Madam Adam Dec 14 at 23:51
  • Can you post more information and screesnhots about your configuration? For example the field settings for term_node_tid, multivalue and rewrite results? – prkos Dec 15 at 3:30
  • It is unbelievable: in order to make screenshots I built the view from scratch and the options for multi-value fields and ID-formatter just appeared. Realy don't know what happened before. – Madam Adam Dec 15 at 12:46
  • It's a well-known issue in programming that sometimes software starts behaving erratically with no reason :) Or maybe it's a case of "It’s harder to read code than to write it". Do you still have the original views? You can compare it to the new one and find out where the "ghost" is. – prkos Dec 15 at 21:48
  • unfortunately, I deleted the old view… – Madam Adam 2 days ago

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.