Hi

I wanted to hide the subscribe block for users who had already subscribed, and this looked ideal.

I can't get it to work though - should it work, or is it out of date? Really like the idea of using the PHP block display settings for this if possible.

Thanks!

Comments

sutharsan’s picture

Status: Active » Fixed

This is at least out of date. I do not know about 4.7.x, but it certainly does not work in 5.x.
However you can use a variable $subscribed in theme_simplenews_block() to turn on/off the block content.

Jason Dean’s picture

Status: Fixed » Active

Hi

Thanks for the info, but I created block-simplenews.tpl.php and tried using the $subscribed variable... but it doesn't seem to be available?

I inserted this into the .tpl to check and it wasn't listed:

<?php print var_export($variables, TRUE); ?>

Am I missing something here? Apologies if this is due to my lack of Drupal understanding and not a Simplenews thing...

sutharsan’s picture

What you are missing is the override of the theme function. See http://drupal.org/node/55126, under 'How to Name your Override Function'.
A block-simplenews.tpl.php is not required.

sutharsan’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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