1

I am following the guide http://www.metachunk.com/blog/adding-related-content-view-drupal-7 to make a related content block. I have 2 taxonomies that my content is tagged with. But the contextual filters are not working.

I think it is because the path is node/[nid] and does not contain a taxonomy term id. How can I fix this so that views can figure out what terms a node is tagged with? Should I provide the default argument another way?

2 Answers 2

1

Have you figured this out? If so could you share your answer?

I do not think the problem is that the path follows any pattern. As long as you create a path that identifies the location of a term and you configure the contextual filter correctly. eg. example.com/whatever-you-want/any-term will work as long as the view path is example.com/whatever-you-want/%. The 'any-term' must be a term in a vocabulary defined for the contextual filter and validation must be set to identify it.

2
  • I didn't figure this out, instead I ended up using similar entries: drupal.org/project/similar it compares data in MySQL to determine what content is similar rather than relying on taxonomies. If you can confirm that your answer works I'll accept it, but I abandoned this approach so I will not be able to test unfortunately.
    – Arosboro
    Nov 3, 2011 at 14:39
  • I have used the format I described successfully. I will also check out the similar module! :)
    – Ashlar
    Nov 3, 2011 at 17:46
0

Youre probably better off using panels to populate the view pane/block with the correct context (term id) but you can also delegate views to do this for you using the information you have (nid) and adding a relationship in views. Depending on if youre trying to list the terms or items mathicn the terms it is done slightly differently but this shoul dget you headed in the right direction. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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