How can I manually add the "Subscribe to" and "Unsubscribe from" links to a template file?

I suppose I have to interact with notifications_ui_link() but have no clue how.

Comments

ShutterFreak’s picture

I found a workaround in the meantime.

Here's the code snippet in node.tpl.php:

<?php if (isset($node->links['notifications_0'])): ?>
<div class="link"><?php
  $label = '';
    if (preg_match('|/subscribe/|', $node->links['notifications_0']['href']) == 1) {
      $label = 'subscribe';
    } else {
      $label = 'unsubscribe';
    }
    print l($label, $node->links['notifications_0']['href'], array('query' => drupal_get_destination()));
?></div>
<?php endif; ?>
jose reyero’s picture

Status: Active » Fixed

Take a look at notifications_get_link()

Status: Fixed » Closed (fixed)

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

BenK’s picture

Subscribing....

dgastudio’s picture

subscribe