I created a block using views and I would like to insert it's content inside a page. The views name is "el_correu" and the block name is "el_correu". I have found at:

that it should be something like:

$block = module_invoke('el_correu', 'el_correu', 'view');
print_r($block);
echo "AAA";
print $block['content'];

but it doesn't work.

Any hint?

thanks

Comments

enboig’s picture

sorry, I forgot to paste the link:

http://drupal.org/node/26502

La vida és una taronja, què esperes per exprimir-la?

jastraat’s picture

$module = 'views';
$delta = 'el_correu';
$block = (object) module_invoke($module, 'block', 'view', $delta);
$block->module = $module;
$block->delta = $delta;
echo theme('block', $block);
enboig’s picture

thanks a lot, it works perfectly now

La vida és una taronja, què esperes per exprimir-la?

josoroma’s picture

Thanks to:
http://drupal.org/node/139668
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/jstools/tabs/...

  $module = 'views';
  $delta = 'latest_videos';
  $block = (object) module_invoke($module, 'block', 'view', $delta);
  $block->module = $module;
  $block->delta = $delta;
  $tab_B = theme('block', $block);

  $form = array();

  $form['example1'] = array(
    '#type' => 'tabset',
  );
  $form['example1']['tab1'] = array(
    '#type' => 'tabpage',
    '#title' => t('One'),
    '#content' => drupal_get_form('user_login_block'),
  );
  $form['example1']['tab2'] = array(
    '#type' => 'tabpage',
    '#title' => t('Two'),
    '#content' => $tab_B,
  );
  $form['example1']['tab3'] = array(
    '#type' => 'tabpage',
    '#title' => t('Three'),
    '#content' => t('Third tab content.'),
  );

  return tabs_render($form);
JuliaKM’s picture

In order to get this excellent example to work, I had to alter the last line to:

print tabs_render($form);