Hello,
I was wondering how I can add twitter_pull_render ($twitkey, $title = NULL, $num_items = NULL, $themekey = NULL) without use PHP filter on a block?
I have tried to add a custom block on template.php
/**
* Implementation of hook_block_list().
*/
function twitter_pull_block_info() {
$blocks = array();
$blocks['twitter_pull_default'] = array(
'info' => t('Twitter stream'),
'weight' => 0,
'status' => 0,
'cache' => DRUPAL_CACHE_GLOBAL,
);
return $blocks;
}
/**
* Implementation of hook_block_view().
*/
function twitter_pull_block_view($delta = '') {
$block = array();
switch ($delta) {
case 'twitter_pull_default':
$block = array(
'subject' => t('Twitter stream'),
'content' => twitter_pull_render('@ openpublish', 'OpenPublish', 6),
);
break;
}
return $block;
}
But no luck, so if someone have a great code I can put in template.php to create a block for Twitter. Because I like the way Facebook Pull has since they have a own 'Facebook Pull'-block.
I appreciate for help.
Comments
Comment #2
joachim commented> I have tried to add a custom block on template.php
Your block code needs to go in a module, not in your theme.
Alternatively, use the plugin for Boxes module.
Comment #3
truls1502Thank you @joachim, problem if I add this on module and later update to newer version, then the code will be removed. Therefore I wish to add the code in my theme. Do you have any idea without need to download more module? I want to minimize number of modules due of performance.
Comment #4
truls1502Comment #5
joachim commented> problem if I add this on module and later update to newer version, then the code will be removed. Therefore I wish to add the code in my theme.
No, you add this in a custom module of your own, not into a contrib module.
Comment #6
truls1502Do you have a link about how to make a custom module? And how to combine a new custom module to an already existing module?
Comment #7
joachim commentedYou should be able to find plenty of documentation and tutorials on that, and there are other sources of help such as IRC.
I'm afraid my free time is pretty limited, so I can't spend that long on support requests.
Good luck!
Comment #8
truls1502Thank you anyway! :)