Skip to content

Instantly share code, notes, and snippets.

@ForestMars
Last active August 29, 2015 13:56
Show Gist options
  • Save ForestMars/9058498 to your computer and use it in GitHub Desktop.
Save ForestMars/9058498 to your computer and use it in GitHub Desktop.
<?php
/* @file
* provides custom blocks
*/
function n101_blocks_block_info() {
$blocks = array();
$blocks['custom1'] = array(
'info'=> t('Custom block 1')
);
$blocks['custom2'] = array(
'info'=> t('Custom block 2')
);
return $blocks;
}
function n101_blocks_block_view($delta) {
$blocks = array();
switch($delta) {
case 'custom1':
$blocks['subject'] = t('Custom Block One');
$blocks['content'] = t('This is our block content');
break;
case 'custom2':
$blocks['subject'] = t('Custom Block Two');
$blocks['content'] = custom_block2();
break;
}
return $blocks;
}
function custom_block2() {
return "This is custom block 2";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment