Created
April 16, 2014 18:54
-
-
Save gabesullice/10920314 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Implements hook_menu_alter() | |
* | |
* Swaps out default taxonomy page callback to use a custom callback. | |
* | |
* @param $items | |
* | |
* @see og_vocab_grid_taxonomy_term_page(). | |
*/ | |
function og_vocab_grid_menu_alter(&$items) { | |
$items['taxonomy/term/%taxonomy_term']['page callback'] = 'og_vocab_grid_taxonomy_term_page'; | |
} | |
/** | |
* Custom page callback that returns only the full view of the term if it is a | |
* member of an OG vocabulary or, if it is not, the default taxonomy term page | |
* (with node listings). | |
* | |
* @param $term | |
* @return array | |
* | |
* @see taxonomy_term_page(). | |
*/ | |
function og_vocab_grid_taxonomy_term_page($term) { | |
if (SOME CONDITION)) { | |
$build = taxonomy_term_view($term, 'full'); | |
} | |
else { | |
$build = taxonomy_term_page($term); | |
} | |
return $build; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment