Created
October 28, 2013 08:36
-
-
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
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 | |
| //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