This seemed easy from the glance, but me as a newbie just can't get it right. This is what I want: I have a nodetype that has some multiple select taxonomy (3 terms, x,y,z). Than there is a nodecomment type, with another multiple select taxonomy (2 terms, a,b). (No parenting relationships are needed between those two vocabularies) EXAMPLE: say i blog about 3 holiday destinations Paris, London, New York, and people comment with "pros" and "cons".
So, simply, what i want is a view (list of node comment links) of say "pros" for all "New York" tagged blogposts. If that is too much, than I could satisfy with a list of all node comments for a particular blog tag, like latest node comments for blog posts tagged "new york". Any hints???
Comments
Comment #1
dark.o commentedbasically, it could be done by child node inheriting parent nodes taxonomy. have been reading around about this issue and I could not find a sollution. Anybody?
Comment #2
dark.o commentedComment #3
dark.o commentedComment #4
merlinofchaos commentedOk, here is what I think you have to do.
1) create a module weight a weight higher than nodecomment so it runs last.
2) create a form_alter on the node edit form. Look for $form['#node']->comment_target_nid -- if that exists, the form is a nodecomment and that nid is the original node.
3) Make sure your vocabulary is valid for your nodecomment node.
4) Using your form alter, change the #access on the select select for the vocabulary in question to hidden and place the terms from the parent node in the #value for that widget.
5) You may then need to manually edit and save existing nodecomments to get them categorized.
Comment #5
dark.o commentedThank you for your help merlinofchaos! That would sure help, once i find somebody that can transform that in action, since I am more of a "what-I-see-is-what-I-got" user (no skills in altering modules, PHP, coding etc.)
Comment #6
dark.o commentedThere is no chance in getting this tutorial in a more "for-dummies" version? :D I reccon lots of people running forums with node comments would like this feature too.
Comment #7
merlinofchaos commentedACtually, in forums you specifically do *not* want the comments to inherit the terms, because then they will show up as top level forum posts. We call that bad.
Comment #8
dark.o commentedOkey mr MOC, thank you for the info regarding forum posts. If you have any other comments regarding me wondering about "taxonomy-inherit-for-dummies", please post it.
Comment #10
fersman4 commentedAny word on this? It's been a few weeks. Kind of surprising that the concept of taxonomy inheritance was not one of the primary design goals of these two modules to begin with, since it is a built-in aspect of the default forum and comment Drupal modules.
Comment #11
fersman4 commentedComment #12
merlinofchaos commentedSorry, if my answers are not good enough, you're out of luck. I've answered more than adequately.
Comment #13
fersman4 commentedmerlinofchaos, thanks for the quick reply. I'm not going to re-activate this issue, so hopefully you see this comment on a closed issue.
I believe I understand the rationale for not implementing this if one assumes post #7 is true. I don't understand why #7 is true, though, so perhaps I need to do more research. I would assume that the "top level forum posts" would be only forum nodes, not comment nodes, page nodes, or any other node type. The only way I could see #7 happening is if "top level forum posts" is defined as any node which has a forum taxonomy term selected. Is this the case?
Edit: I created a page with a forum taxonomy term. I didn't see the page included as a top-level forum topic, so I was not able to recreate the circumstances of post #7. I also tried it with a comment for completeness sake, with the same result.
Comment #14
merlinofchaos commentedThat is, in fact, the case. Forums are not restricted to just the 'forum post' type.
Comment #15
merlinofchaos commentedNote that with nodecomment 2.x there is a relationship you can add, 'parent or self' or something like that, that you can use to get the right node to check terms against in a view.
Comment #16
fersman4 commentedOops, I didn't expect you to reply so quickly so I edited post #13 with an update. So that I don't mess up the comment order logic, I'll repost my update here:
I created a page with a forum taxonomy term. I didn't see the page included as a top-level forum topic, so I was not able to recreate the circumstances of post #7. I also tried it with a comment for completeness sake, with the same result.
Comment #17
fersman4 commentedYeah, that's a feature I may have to use. I was hoping to just use the base-drupal taxonomy system (e.g. taxonomy/term/1), which is simple. But I guess without nodecomment taxonomy inheritance, the views relationship method is the way to go, despite its complexity.
Comment #18
oskar_calvo commentedTo make this there is a more easy way.
with hook_nodeapi:
Only hidden the taxonomy as say merlinofchaos