Posted by pkcho on May 5, 2010 at 6:28am
I have a taxonomy vocabulary "topics" with a number of terms "news, cover stories, people and places, etc...". Each article node that I created has one of the these terms and other taxonomy terms created by the semantic tagging service, Calais. I use the "topics" taxonomy to organize my articles throughout the site.
Searching through the web, I've come across solutions that using views and arguments to create a block with related nodes, but they create relationships based on all of the terms of the node (including the Calais terms).
I want to be able to create a block for the article that is based on the "Topics" terms for that node.
Help.
Comments
View Filter
Put a filter on the view for the particular vocabulary; in this case only show terms from the Topics vocabulary that are tagged on this node. Or did I miss something?
Panels/Views can do it
Panels/Views can do it without any coding. Take a look at the context/argument...
For any given article...
I probably didn't explain this right...
Any given article node, will fall under one of a number of TOPIC terms (news, cover stories, chamber, people and places, etc...). So, when someone is viewing an article that happens to be a NEWS story, I would like the block to display other NEWS stories. When someone is viewing a CHAMBER story, I would like them to see other CHAMBER stories.
In addition to the topic terms that I created for the articles, there is the Calais semantic tagging, which adds additional terms to the mix. Those are definitely useful for other things, but I do not want them to affect what shows up in the block.
I know I need to use ARGUMENTS for this, but I don't know how to make it single out terms under the TOPIC taxonomy, so that related CHAMBER stories show up next to the current CHAMBER article.
Thank you for your help.
Yes, that's what I said. In
Yes, that's what I said. In Panels make some contexts and pass them as arguments in Views.
I'll look at panels, but I'm
I'll look at panels, but I'm not sure I want throw panels into the mix. Can I implement panels without changing the way these article node pages are handled?
I think you would have to
I think you would have to create a node variant panel in order to have access to that view pane. But it's not that scary, I promise!
I am wondering the same
I am wondering the same thing. I assume that you are running on OP2.0 so you have the context module active. If that is the case you might be able to use code to get the top level TID to use as a views argument. http://drupal.org/node/794428
Marine job board with Drupal 7 at http://windwardjobs.com
OK, we got a response.
OK, we got a response. http://drupal.org/node/794428 What is happening here is that the context.module is loading the node before it gets passed to views (I think) so it can pass variables to views such as the uid and nid of the node as an argument. There are a couple other issues that explain how to create the module and implement it. I wrote one that maps the variables in the module to the views arguments form elements when building the view. I used it successfully to pull the the nid and pass it to a function in the prev/next API module to pull the next and previous nodes of the same type or other criteria from a database table. Once I passed the nid and converted to the nid or the previous or next node I was able to build a view with fields of title, teaser and micro thumbnail image if there was one. I just don't have the time to mess with the taxonomy term right now but I'm sure that it will work. My article taxonomy vocabulary is before the OpenCalais vocabulary in weight as implemented in my system so the taxonomy term that I use to classify the articles will when using dev render always be the first so the top level taxonomy term works in my case. You will have to make sure of this using dev render that the term that you want to associate all the content in the block is top level.
Marine job board with Drupal 7 at http://windwardjobs.com
I just played with the
I just played with the vocabularies. I moved the articles vocabulary after the OpenCalais and it put that term last. Then I moved to the be first on the vocabulary page and it put it first so I assume that weight of vocabulary effects the order of terms. make sure it's first.
Of course, you could just take the easy route and use panels context but this way seem a lot more fun because it's adventurous and ambitious.
Marine job board with Drupal 7 at http://windwardjobs.com