Theme taxonomy term page based on depth Is there any solution on how theme the taxonomy term page per depth? Though this is doable with Views + TVI, we don't usually allow admin to manage TVI, but they're able to add new term and they're allowed to rearrange the terms. I would like that each depth has a different layout, but automatically changing based from its depth. This can done through hooks or how to achieve this in views?

For instance:

if ($depth == 0) {
  print $views_0;
}
elseif ($depth == 1) {
  print $views_1;
}
elseif ($depth == 2) {
  print $views_2;
}
else {
  print $views_default;
}


and so on...
Create a funtion to retrive term depth 

//Gets the depth of the term id
function MYMODULE_term_depth($tid) {
  $parent = db_query("SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = :tid", array(':tid' =&gt; $tid))-&gt;fetchField();
  if($parent == 0) {
    return 1;
  }else  {
    return 1+MYMODULE_term_depth($parent);
  }
}


And Print the views based on depth 

$depth = MYMODULE_term_depth($tid)
if ($depth == 0) {
  print views_embed_view('views_0');
}
elseif ($depth == 1) {
  print views_embed_view('views_1');
}
elseif ($depth == 2) {
  print views_embed_view('views_2');
}
else {
  print views_embed_view('views_default');
}


pass the view machine name to views_embed_view