Quantcast
Channel: drupal 7
Viewing all articles
Browse latest Browse all 19

Create your own custom Drupal block programmatically

$
0
0

Super duper simple example on how to programmatically create your own custom Drupal blocks and display any content.

Code snippet below needs to be in a custom module.

/**
* Implements hook_block_info().
*/
function YOUR_MODULE_block_info() {
  $blocks = array();

  $blocks['YOUR_BLOCK_ABC'] = array(
    'info' => t('YOUR BLOCK NAME'),
  );

  return $blocks;
}


Viewing all articles
Browse latest Browse all 19

Trending Articles