Download & Extend

Call in a block that is generated by another module

Project:Magic Tabs
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:corydorning
Status:closed (fixed)

Issue Summary

The magic tabs have been working great! I have been able to call in my views and have the following code:

function magic_tabs_example_callback($active = 0) {
  $tabs[] = array(
    'title' => t('Events'),
    'content' => theme('view', 'Tabs_Events'),
  );
  $tabs[] = array(
    'title' => t('News'),
    'content' => theme('view', 'Tabs_News'),
  );
  $tabs[] = array(
    'title' => t('Stay Informed'),
    'content' => t('<p>Content of Stay Informed</p>'),
  );
  return $tabs;
}

For the "Stay Informed" tab I'd like to call in a block that is created by the simplenews module. I tried various ways using the "custom block" method but didn't have any luck b/c the $bid isn't equal to a number. For instance, when I mouse over "configure" to get the block id of my simplenews block, I get the following path: /admin/build/block/configure/simplenews/newsletter-4 instead of the usual "/admin/build/block/configure/block/82" for custom blocks.

How can I adapt the following code to call in the simplenews block:

$bid = 2;
  $block = (object)module_invoke('block', 'block', 'view', $bid);
  $block->module = 'block';
  $block->delta = $bid;
  $tabs[] = array(
    'title' => t('Stay Informed'),
    'content' => theme('block', $block),
  );

Any help is GREATLY appreciated!

Comments

#1

Nevermind, I FIGURED IT OUT! My code for the last tab is as follows:

  $bid = 'newsletter-4';
  $block = (object)module_invoke('Simplenews', 'block', 'view', $bid);
  $block->module = 'block';
  $block->delta = $bid;
  $tabs[] = array(
    'title' => t('Stay Informed'),
    'content' => theme('block', $block),
  );

#2

Assigned to:Anonymous» corydorning
Status:active» fixed

see above.

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.