I'm slowly tearing out what little of my hair I have left trying to come up with a solution for this. If anyone is able to offer any advice I'd be really really grateful.
In a node view I'm filtering to a specific node type. Within that view I am displaying 'All Terms' of a specific vocabulary. This vocabulary is allowed to have multiple terms selected from it.
I'm wanting to show the individual Term Description of each of these Terms (I'm actually rewriting the output of 'All Terms' so that the term displays the description as a link to its term page). This works fine for nodes which only have one term selected, however when there are multiple terms selected only the first term's description is pulled through, and as such is used for each following term link.
I wondered whether the solution to this lays in theming, pulling in the term description for each term being displayed in the view. However I have had no luck finding the required variables to use.
I notice something relating to this being mentioned here http://drupal.org/node/345571#comment-1189361 Does that mean it's not possible?
I know everyone involved with views is very busy, so apologise if I'm being a nuisance with this query. But if anyone is able to point me in the right direction (or point blank tell me it can't be done) that would be fantastic.
Many thanks - Will
Comments
Comment #1
dawehnerThis is a feature request. So it's not possible currently without a patch. You would have to write a own field_term_node_description handler which uses the pre_render method to load every description and display it with render_item
Comment #2
willhowlett commentedMany thanks. I'll have to roll up me sleeves and get my head round this api business then.
Cheers - Will
Comment #3
maikeru commentedJust found this issue when I was attempting the same thing. Thought I'd mention that I found it easier to add the description as a token rather then using render_item. You'll still need your own pre_render function to grab the description.
So I have something like this in my custom views handler:
Then its available for use in the views UI where you can rewrite the output of the field.
Hopefully that helps people looking at the same thing.
Comment #4
OnkelTem commentedmaikeru
Would you provide more of your code? Need the same thing, but I've never dealt with custom views handlers and afraid have no time atm to learn this subject from scratch :(
Thanks in advance
Comment #5
Letharion commentedComment #6
Letharion commentedSorry, feature request, not support.
@Merlinofchaos
Task, or not?
Comment #7
merlinofchaos commentedUnassigned task. A patch of the above code totally makes sense and would be considered for 3.x
Comment #8
willhowlett commentedCame back to this after literally ages. Just as an update found a very simple way of achieving this through the theme layer if that's of use to anyone reading this.
I used something like this in a nid field tpl. Not as nice as doing it properly with the methods detailed above, but quick and easy.
Comment #9
couturier commentedMost people are working in Drupal 7 and Drupal 8 now. When D8 is released in less than a year, support for D6 will be dropped.