I have ddblock set up and running perfect. It has improved dramatically since I tried a year ago and looks great and was relatively easy to install and get to work.

Now my editor wants to actually use it. He wants to create a bunch of dd_block content nodes and call them specifically within the same ddblock on different pages.
So, for example, we might have 30 dd_block_content_nodes.
Using php module_invoke on page X there would be an embedded block which would show dd_block_content_nodes 1,6,9,14. On page Y there would be an embedded block which would show dd_block_content_nodes 1,4,23,29.

The editor doesn't want to have to edit the view each time to specify which nodes to use. Instead he would like to just, on each page he wants the block to appear, to do something like
on page Y

$block = module_invoke('ddblock', 'block', 'view','3','1,6,9,14');
print $block['content'];

and on page X

$block = module_invoke('ddblock', 'block', 'view','3','1,4,23,29');
print $block['content'];

I have set up the view to accept nid (multiple) as arguments, but I can't figure out how to pass them into the php code on each page. Is this do-able?

If not how would you suggest we best approach this.

Thanks for a great module.

Comments

ppblaauw’s picture

This is not possible with

$block = module_invoke('ddblock', 'block', 'view','3','1,4,23,29');
print $block['content'];

Don't have a suggestion yet, how this can be done best, the way you require.

jasonawant’s picture

Hi,

I don't think the fourth parameter in module_invoke() is correct. I think the fourth parameter should use the 'view_name-display_#' like the following.

$block = module_invoke('views', 'block', 'view', 'view_name-block_3',$arg);

jwant