I have a block that I need to embed in a node's Body field. I've tried
module_invoke() + PHP Filter, and I've also tried the Insert Block module. In both cases, whenever I embed a Views block, it makes the entire Body field disappear from the rendered page.
Embedding a Block-module block does not make it disappear; the block renders normally. I should also note that when using
module_invoke(), that function call itself is sufficient to break the page; even if I delete the
print render() line, it's still broken.
More info as I find it:
When the page is broken,
node.tpl.phpdo not output anything.
Oh, and I forgot to mention that no PHP errors are being generated. Which I can barely believe too.
When the my embed attempts are active, the
system_mainblock array is entirely missing from
$page['content']in page.tpl.php. The
#sortedflag is missing from there as well.
Shabir's method below yields the same behavior as the other two methods I've tried.
dpm()ing the block array (or Shabir's function's return value) shows the block contents as expected. However, the act of rendering the block makes none of the page content get printed.
Anyone have any ideas as to what's happening?
Now I'm having the problem when I call
module_invoke() inside the views-view-unformatted--%.tpl.php file. All the view templates will send
dpm() calls where they should go, but the content just disappears.
Furthermore, when I
dpm($page) in page.tpl.php,
$page['content']['system_main']['main']['#markup'] shows a bunch of content for the site's front page! It still doesn't show up, though.