I want to place a Simplenews subscription form on my front page that I implemented using the Front Page module in 'full' mode. How do I do this?
-
Have you tried creating a simple news block? If I understood your question correctly, then you could override Simple News and and place it as a block.– JT-DrupalCommented Oct 27, 2011 at 16:29
-
I tried adding the block using this code: <?php $block = module_invoke('simplenews','block_view','5'); print render($block); ?> But it didn't work.– modoqCommented Oct 31, 2011 at 14:21
2 Answers
Try this:
<?php $block = module_invoke('simplenews','block_view',5); print render($block); ?>
The number 5 shouldn't be sent as a string.
And if you are putting this in a textarea on Drupal's backend, you need the PHP input filter, which is generally a bad idea. Better to go through the theming system, add a region, and put the block there.
You should print render($block['content']);
instead print render($block);
So solution will be:
<?php $block = module_invoke('simplenews','block_view',5);
print render($block['content']); ?>
5= your block id (go to http://example.com/admin/structure/block
and find simple newsletter block