How to create page tpl for taxonomy vocabulary
Solution:
find for themename_preprocess_page add this is template.php
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)))
{
$tid = arg(2);
$vid = db_query("SELECT vid FROM {taxonomy_term_data} WHERE tid = :tid", array(':tid' => $tid))->fetchField();
$vars['theme_hook_suggestions'][] = 'page__vocabulary__'.$vid;
}
now create tpl named as "page--vocabulary--X.tpl.php";
Solution:
find for themename_preprocess_page add this is template.php
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)))
{
$tid = arg(2);
$vid = db_query("SELECT vid FROM {taxonomy_term_data} WHERE tid = :tid", array(':tid' => $tid))->fetchField();
$vars['theme_hook_suggestions'][] = 'page__vocabulary__'.$vid;
}
now create tpl named as "page--vocabulary--X.tpl.php";
0 comments: