Hi,

im having problems getting the block shown in a page using module_invoke();
need help :)

thx alot

Paschka

Comments

danielb’s picture

I don't understand what the problem is. You don't need to use module_invoke to display the block.

Paschka’s picture

i have to use module_invoke in case of how my page ist structured, in which i want to display the block.
the autocomplete "block" needs to be shown between two handcoded segments and the only way to realize this in the page is to use module_invoke. i could realize it through making three blocks for this page, but my "blocks-list" is already very long and i love dynamic solutions ;)
i tried it with module_invoke(block, block, view, number)...but it didnt work, not only because the $delta is wrong but it seems to be of another kind than "block". i think the blocks in this module have some kind of other description or function call. being still a novice to php i cannot completely understand the module source code :)

any ideas? :)

greetings

Paschka

danielb’s picture

are you doing something like this?

<?php

$block = module_invoke('autocomplete_node_finder', 'block', 'view', 0);
print $block['content'];

?>

can you post your code so we can compare?

Paschka’s picture

haha thx it works with your code now :)

the code was nearly the same but i tried:

$block = module_invoke('block', 'block', 'view', ~);  // (and the last $delta in my drupal site)
print $block['content'];

trying the module name was not in my brainwave ^^

kind regards

Paschka

Paschka’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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