rix
rix

Reputation: 10632

Invoke a block from a template file with arguments

I have written a custom module which creates a block. I invoke the block from a template file using the following code.

$block = module_invoke('my_mod', 'block_view', 'block_1a', $an_argument);
print $block['content'];  

I need to access $an_argument in the module when the block is created.

How can I access the argument I pass to the block when it's invoked?

Upvotes: 0

Views: 1342

Answers (1)

joakaune
joakaune

Reputation: 141

I believe you would have to implement the hook_block_view to handle your argument.

The api docs for hook_block_view

Upvotes: 1

Related Questions