Created
March 4, 2014 13:41
-
-
Save LarsEliasNielsen/9346673 to your computer and use it in GitHub Desktop.
Drupal 7 Module Development: Block Content
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 | |
/** | |
* 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