Get root taxonomy name in drupal view?

Ok, I haven't found a way to do this purely through the Views administration, but you could create a template file for a Views field to do this. It sounds like you want to replace the term name with the root name If you could make that field have the taxonomy term id (tid) instead of the name, you can create a template for the field (determine the name for the tpl file under Basic Settings->Theme ) and add this code:? Php $term_parents = taxonomy_get_parents_all($output); print $term_parentscount($term_parents) - 1->name;?

This will replace the term id and instead will display the root term name in its place If you are stuck on using the name, you could always throw a database query in there to convert the name to the term id to use with the template code.

Ok, I haven't found a way to do this purely through the Views administration, but you could create a template file for a Views field to do this. It sounds like you want to replace the term name with the root name... If you could make that field have the taxonomy term id (tid) instead of the name, you can create a template for the field (determine the name for the tpl file under Basic Settings->Theme) and add this code: name;? > This will replace the term id and instead will display the root term name in its place.

If you are stuck on using the name, you could always throw a database query in there to convert the name to the term id to use with the template code.

Awesome man! Great work! But :( it's almost done...I have the tid as "Exclude from display" and in the next field I'm "rewriting the output of the field"...unfornately it shows the tid and not the name...I know that he goes through the template file because a die in there crashes the website :) Can you help once again?Thanks.

– foxtrot Mar 17 at 11:49 @foxtrot ok, how are you rewriting the other field? Can you post what you entered in the rewrite box? – Laxman13 Mar 17 at 14:38 I've fixed it...thanks anyway.

– foxtrot Mar 21 at 16:17.

I know how to do this in Drupal 6: views with an argument with taxonomy_node_get_terms(). However, this function does not exist in Drupal 7. What is the correct way to get the terms associated to a node in Drupal 7?

Is there even a better way? I noticed the option "Load default argument from node page, thats good for related taxonomy blocks." for the Taxonomy: Term ID argument. However, it doesn't seem to work (the option does not get saved).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions