5

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?

2
  • 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-Drupal
    Commented 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.
    – modoq
    Commented Oct 31, 2011 at 14:21

2 Answers 2

1

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.

http://drupal.org/node/1088718

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.