Created
July 22, 2015 08:26
-
-
Save mcjwsk/52333de670c083e01c35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = Taxonomy page | |
description = Override taxonomy term page. | |
package = Custom | |
version = 7.x-1.0 | |
core = 7.x | |
dependencies[] = taxonomy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Main module file. | |
*/ | |
/** | |
* Implements hook_menu_alter(). | |
*/ | |
function taxonomy_page_menu_alter(&$items) { | |
$items['taxonomy/term/%taxonomy_term']['page callback'] = 'taxonomy_page_view'; | |
$items['taxonomy/term/%taxonomy_term']['page arguments'] = array(2); | |
$items['taxonomy/term/%taxonomy_term']['file'] = 'taxonomy_page.pages.inc'; | |
$items['taxonomy/term/%taxonomy_term']['file path'] = drupal_get_path('module', 'taxonomy_page'); | |
if (isset($items['taxonomy/term/%taxonomy_term']['module'])) { | |
unset($items['taxonomy/term/%taxonomy_term']['module']); | |
} | |
if (isset($items['taxonomy/term/%'])) { | |
unset($items['taxonomy/term/%']); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Menu callbacks. | |
*/ | |
/** | |
* Taxonomy term page callback. | |
*/ | |
function taxonomy_page_view($term) { | |
$vocabulary_name = $term->vocabulary_machine_name; | |
switch ($vocabulary_name) { | |
/* | |
case 'collections': | |
return views_embed_view('collections', 'block', $term->tid); | |
break; | |
*/ | |
default: | |
return taxonomy_term_page($term); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment