2

I am using Viewfield module to display taxonomy terms of a node is referencing to. I am not using the default taxonomy field available in views because I want more freedom on manipulating the rendered taxonomy terms.

When I am in the node page I use contextual filters and I provide the default value from the URL. Easy. But...

For listing nodes of a taxonomy term I use views also and I want the same functionality in there.

The only way I can do this is by providing the default value from the nid of every node (row). So how can I get the nid as a contextual filter in such case?

Thanks

1

Use the Views Field View module and add Content: Nid as a field and check mark ☑ exclude from display.

Add Global: View a field and pass [%nid] token/replacement pattern as an argument as contextual filter.

Note: make sure it's arranged above your View field view so you have access to the [%nid] replacement pattern/token.

  • Nop...doesn't do the trick and what I did is added nid and viewfield in my fields and put the token of nid to the contextual filters as a fixed value. See this [link]i.imgur.com/PLE5zRU.png Maybe is the fixed value the issue? – pierostz Jul 23 '16 at 8:28
  • @pierostz updated my answer, you should use this other module. – No Sssweat Jul 23 '16 at 8:40
  • Well getting closer. I have created a "child" view as described in the module's readme file. I have added this view as a "Global : View" and put it under the nid field. In the Global: View settings I have added [!nid] as a contextual filter (I also tried [nid] as you say) while choosing the correct child view, but I get the full list of my taxonomy terms. It seems like the view isn't using my contextual filter. Also see image [link]imgur.com/fc9TtDY – pierostz Jul 23 '16 at 10:20
  • @pierostz try with [%nid] – No Sssweat Jul 23 '16 at 10:23
  • @pierostz also, for the view you're adding as a field, make sure the contextual filter is like this – No Sssweat Jul 23 '16 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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