When I'm on a node that has a taxonomy term associated with it, I want to show a contextual block on the same page using node attach, which shows other items with the same taxonomy term. I keep trying to using arguments but it's not working. Sometimes I get no result and sometimes I just get a repeat of the content already on the page.
I get a repeat of the content if I choose Taxonomy Term ID from URL or if I say Node ID from URL and then try to validate by taxonomy term.
If I say taxonomy Term ID from URL and then validate by taxonomy term or id, I get this error:
Error Description:
Fatal error: Class 'views_plugin_argument_default' not found in /var/www/vhosts/mysite.com/httpdocs/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc on line 8
Can you help?
Becky
Comments
Comment #1
beckyjohnson commentedI updated to the dev version of this module because I thought my issue was that the token [term] wasn't passing to the nid argument. However, I don't think thats the issue now because I still can't get it to work. I just want to pull in a view of related taxonomy items to the node. How is this so hard to do?
Comment #2
becw commentedWith the "node content" display, views_attach will only supply an NID argument. This means that if you want to find nodes that share a taxonomy term, you have to start from the current node. Your View has to look at the current node --> current node's taxonomy terms --> other nodes with those taxonomy terms.
The "Taxonomy: Node" relationship SHOULD do what you want, except that it is broken--but that's an issue for Views itself...
Comment #3
beckyjohnson commentedThanks for the info. Are all taxonomy term related things broken in views? You know, in terms of relationships and arguments?
I tried out using taxonomy relationships, just to see what would happen, and yeah, it didn't work..
Comment #4
Crell commentedGiven the way taxonomy works in Drupal 6, yeah, it doesn't play nicely with Views. I honestly gave up on using taxonomy because the integration was so bad. I know merlin was trying to come up with something better but the taxonomy table structure just makes that very difficult.
Since the issue here is with the Views-Taxonomy integration I'm closing this issue. I would refile over to Views but I'm sure there are enough Views-Taxonomy issues there already. :-)
Comment #5
beckyjohnson commentedNo problem. I understand :)
Comment #6
brycesenz commentedI needed to implement this as well, and I think I found a decent workaround that doesn't require TOO much custom coding. You need the PHP View Filter module (http://drupal.org/project/viewsphpfilter), then do the following:
1. Enable the filter "Node: Node ID PHP handler" for the view that you wish to use for Node Content.
2. (Hard-ish part) Write the appropriate PHP code!
For example, if I wanted a my node attachment to be a view of any node which shared at least one taxonomy term, I could write something to this effect:
Hope that helps!
Comment #7
beckyjohnson commentedWow! Thanks for posting this. It's really helpful.
Comment #8
ressaAn alternative way of attaching a contextual block to a node, based on taxonomy term, is to use Similar By Terms module, http://drupal.org/project/similarterms
Remember to filter by content type.
For Views Pages, based on taxonomy term, the Views Attach module works fine!