Last active
August 29, 2015 13:56
-
-
Save ForestMars/9058498 to your computer and use it in GitHub Desktop.
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 | |
/* @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