In Drupal 7, on my frontpage custom template, i want to show a text if the site is allowing new users to register. Any clues? Thanks
-
You can do a variable_get call in template.php to check the value of the registration state, but I can’t recall he name of the variable. It’s located in the variables database table. Based on that value you can create a new template variable to show a message.– KevinCommented Jul 30, 2018 at 15:48
Add a comment
|
1 Answer
In a preprocess function for your template, add code something like:
$variables['is_registration_open'] = variable_get('user_register') == USER_REGISTER_VISITORS;
Then in your template:
<?php if ($is_registration_open) : ?>
<h3>Registration is open!</h3>
<?php endif; ?>