Include simpleads block in custom template

Created on 7 November 2019, about 5 years ago
Updated 9 June 2023, over 1 year ago

Hello all,

First of all, thank you for the great module.

I'm running into an issue using simpleads.
I have an image add block that displays well on my website.

I would like to display that block in a custom template.
I've looked around but found nothing.

I tried to invoke my block in a template but

$block = module_invoke('simpleads', 'block_view', 'ad_groups_13269');
print $block['content'];

$block2 = block_load('simpleads', 'ad_groups_13269');
$output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block2))));
print $output;

var_dump($block);
var_dump($block2);

outputs

array(2) { ["subject"]=> string(10) "Publicité" ["content"]=> string(475) "«  }

object(stdClass)#406 (13) { ["bid"]=> string(3) "124" ["module"]=> string(9) "simpleads" ["delta"]=> string(15) "ad_groups_13269" ["theme"]=> string(16) "xxx" ["status"]=> string(1) "1" ["weight"]=> string(3) "-28" ["region"]=> string(7) "content" ["custom"]=> string(1) "0" ["visibility"]=> string(1) "0" ["pages"]=> string(0) "" ["title"]=> string(0) "" ["cache"]=> string(2) "-1" ["subject"]=> string(10) "Publicité » }

But this output does not include the content of my block...

I'm stuck, can anyone help me out ?

Thank you very much

💬 Support request
Status

Closed: won't fix

Version

1.9

Component

Documentation

Created by

🇫🇷France joachim desarmenien Bordeaux

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024