Closed (fixed)
Project:
Panels
Version:
6.x-3.0
Component:
API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
31 Aug 2009 at 16:55 UTC
Updated:
12 May 2026 at 14:00 UTC
Hi,
I've built a panel page (via chaos tool suite) to get some variants of a node view.
In this panel page, i've placed a custom block from some one of my custom modules.
I don't figure out how to get the node nid to the custom block in order to modifie the block's content.
Let's imagine I've made a custom block in a custom module like this :
function custom_module_block($op = 'list', $delta = 0, $edit = array()) {
switch($op) {
case 'list': {
$blocs=array();
$blocs['text_block'] = array(
'info' => t('Test block'),
'cache' => BLOCK_CACHE_PER_ROLE | BLOCK_CACHE_PER_PAGE,
);
return $blocs;
}
case 'view': {
$block=array();
if ($delta == 'text_block') {
$contenu = "Test block content";
$block['subject'] = t('Test block');
$block['content'] = $contenu;
}
return $block;
}
}
}
Any idea to achieve this ?
Comments
Comment #1
merlinofchaos commentedYou will be a lot better off if you create a content type plugin rather than using a block. The whole reason that content type plugins exist is that blocks cannot easily get information passed to them, and content types can.
A good article on doing that is here: http://shellmultimedia.com/articles/creating-content-type-ctools-panels-3