Hi everyone,

I have the current webform block showing form nid 12 in the blocks list, tied to a custom region I called "quickform". It's there and it looks great on the home page region I created, as I styled all the form elements in my css within the #quickform div to look a certain way.

Now I would like the same block to appear in the "right-sidebar" or #right-sidebar div that I've created on my content pages.

In the page.tpl.php file i've tried including it via a block invoke trying to use the names "webformblock12", "webform12", "webformblock_12", "webformblock-12", "webform_12", "webform-12", etc... and I can't get it to appear. If there's a way of duplicating the block itself, or perhaps calling it using an alternative method, please let me know!

Thanks,

Raff

Comments

Anonymous’s picture

Status: Active » Fixed

So I figured it out. In order to re-purpose the block for further use, I invoked it by looking at the configuration page URL.

The block name was webformblock, and the delta property was 12, so webformblock12 was not the solution, it was actually achieved using the code below:

<?php  $block = module_invoke('webformblock', 'block', 'view', 12);
print $block['content'];
?>

You may have to insert:

print '<h2>title goes here</h2>'

ahead of the print $block line, so that you can properly insert the title, as for some reason the block title was not showing up, even after editing it.

Status: Fixed » Closed (fixed)

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

DjebbZ’s picture

Component: Miscellaneous » Code

I had to pass different parameters to do the same thing than you (manually embedding a webform block in my tpl file) :

$newsletter = module_invoke('webform', 'block', 'view', 'client-block-187')

Notice that I used the webform module, and the delta client-block-187. Both being seen in the blocks page when hovering the 'configure' link.

So, module maintainer(s), what's the proper use ? Why is there a difference between Careless and me ?

DjebbZ’s picture

Status: Closed (fixed) » Needs review

Adjusting status. I don't want to disturb the issue queue, I'd just like to understand the difference. Thanks in advance !