Created
April 14, 2014 11:50
-
-
Save WeeHorse/10641063 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
<?php | |
// implements hook_block_info | |
function block_from_current_node_block_info() { | |
$blocks = array(); | |
$blocks['block_from_current_node'] = array( | |
'info' => t('Block from current node'), | |
'cache' => DRUPAL_NO_CACHE | |
); | |
return $blocks; | |
} | |
// implements hook_block_view | |
function block_from_current_node_block_view($block_name = '') { | |
if($block_name == 'block_from_current_node'){ | |
return array( | |
'subject' => t('Block from current node'), | |
'content' => get_content_from_current_node() | |
); | |
} | |
} | |
function get_content_from_current_node(){ | |
//header('Content-type: text/plain; charset=utf-8'); | |
//var_dump(func_get_args()); | |
//drupal_exit(); | |
var_dump(menu_get_object()); | |
return $yourCustomHtml_or_page_array; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment