Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Created May 3, 2015 04:58
Show Gist options
  • Save henrytran9x/ae0a6a7cf519bcbfe2b3 to your computer and use it in GitHub Desktop.
Save henrytran9x/ae0a6a7cf519bcbfe2b3 to your computer and use it in GitHub Desktop.
theme_hook_suggestions for taxonomy page Drupal 7
function mytheme_preprocess_page(&$variables) {
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
//kiểm tra + thêm điều kiện khi mình muốn load suggestion cho term hoặc vocalbulary nào
$variables['theme_hook_suggestions'][] = 'page__taxonomy_term';
}
}
// Vào thư mục 'templates' tạo file page--taxnomy_term.tpl.php ..overwrite page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment