Skip to content

Instantly share code, notes, and snippets.

@LarsEliasNielsen
Created March 4, 2014 13:41
Show Gist options
  • Save LarsEliasNielsen/9346673 to your computer and use it in GitHub Desktop.
Save LarsEliasNielsen/9346673 to your computer and use it in GitHub Desktop.
Drupal 7 Module Development: Block Content
<?php
/**
* Implements hook_block_view().
*
* Creates content for our block. It sets the title for the block, and the
* content.
*
* @url: https://api.drupal.org/api/drupal/modules!block!block.api.php/function/hook_block_view/7
*/
function espn_news_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'espn_news':
// Set block title.
$block['subject'] = t('ESPN News');
// Set block content.
$block['content'] = 'Hello World';
}
return $block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment