1
votes

In drupal 8 I have a content type "article" which has taxonomy terms. Now I would like to make a list of those terms in a block so I can put it somewhere else on the page than the bottom of the node content.

Edit: I tried to follow https://drupal.stackexchange.com/questions/69426/get-list-of-taxonomy-terms-for-current-node-through-views but I can't select NID in step 4.

1
I've tried a view with taxonomy terms with all kinds of relations and contextual filters. I think it must be somewhere in that area, but I can't seem to find the right combination.Matthanol
drupal.stackexchange.com/questions/69426/… I have tried this, butI can't select NID in step 4 of the answer, so it doesn't work.Matthanol

1 Answers

1
votes
  • Create a 'Taxonomy Terms' view, choose block attachment
  • Add a relationship, something like 'Content using field_my_taxonomy_term' - in this case you want to use the entity ref field on your 'Article' content type.
  • After adding the relationship, add a contextual filter, in this case it will simply be 'ID' for category 'Content': id

  • After adding, configure the relationship field and select 'Provide default value' in the first bullet point: filter

Then that should be it. You can use the 'preview' field to enter a node id and see results in the view itself.

view

Afterwards, you can add the block to the page you want and voila, the block should work correctly