Skip to content

Instantly share code, notes, and snippets.

@vdchristelle
Created October 28, 2013 08:36
Show Gist options
  • Select an option

  • Save vdchristelle/7193279 to your computer and use it in GitHub Desktop.

Select an option

Save vdchristelle/7193279 to your computer and use it in GitHub Desktop.
check if we have a node page or a taxonomy page in a custom block content function
<?php
//get object
$obj = menu_get_object('node',1);
if (isset($obj)){
// it's a node page
} else {
// it's a taxonomy page
$obj = menu_get_object('taxonomy_term',2);
}
dpm($obj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment