There doesn't seem to be a "class" or "id" tag in the view source next to the "subscribe link" under the posts in the links section. I would like to be able to add a small icon to this list of links right in front of the "Subscribe" tag and have been able to do it for all of my other links except this one.

For example my links say:

Email this Digg Stumble Upon Subscribe Add Comment

in front of each I am able to add an icon using css, except subscribe.

i have searched the module for the right place to put it, but was unsucessful -- can you help?

Thanks

Julie

CommentFileSizeAuthor
#5 subscription-class.patch1.29 KBdvessel

Comments

salvis’s picture

Good point.

Add (one line!)

          'attributes' => array('title' => t('Receive notifications about changes and/or comments to this page (and possibly similar pages).'), 'class' => 'subscriptions_subscribe'),

to the array returned from subscriptions_ui_link() in subscriptions_ui.module.

Thanks!

spyderpie’s picture

Status: Active » Closed (fixed)

Thank you - works beautifully!

salvis’s picture

Version: 5.x-2.0-beta12 » 5.x-2.0-rc1
Status: Closed (fixed) » Fixed
dvessel’s picture

Status: Fixed » Active

Salvis, that should actually be like this:

return array('subscriptions-subscribe' => array(
  'href' => $_GET['q'] .'/subscribe',
  'title' => t('Subscribe'),
  'fragment' => 'subscriptions',
  'attributes' => array('title' => t('Receive notifications about changes and/or comments to this page (and possibly similar pages).')),
));

That eventually gets fed into theme_links and the key is used to add a class the the parent list item, not just the anchor. Doing it this way will add it to both. I need to get in a selector for the list item but all it does is add a zero class which is illegal and unworkable.

dvessel’s picture

Status: Active » Needs review
StatusFileSize
new1.29 KB

And the patch.

marcp’s picture

See http://drupal.org/node/64279#handling-of-links for an explanation of why dvessel's patch makes hook_link() fully 5.x compatible.

salvis’s picture

Status: Needs review » Fixed

Thanks, dvessel and marcp!

Committed to CVS, the subscriptions 5.x-2.0-dev snapshot release should show up within 12 hours.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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