Hi,

I have now been able to get taxonomy terms working in the Notifications module and wondered how I can allow users to subscribe to specific content types by taxonomy terms. i.e. Content Type - workshops AND Taxonomy Term - life drawing.... OR Content Type - workshops AND Vocabulary - Art

Thanks in advance!

Comments

OnthegOinOz’s picture

Title: How to subscribe to specific content type by taxonomy term/tag AND Vocabulary » Subscribing to specific content type by taxonomy term/tag OR Vocabulary
OnthegOinOz’s picture

Title: Subscribing to specific content type by taxonomy term/tag OR Vocabulary » Subscribing to content type tied to taxonomy term/tag OR Vocabulary
thadwheeler’s picture

Caminoz74 - have you had any further development on this? I am looking at something very similar.

OnthegOinOz’s picture

nothing yet but I just found another person wanting it - http://drupal.org/node/877204

OnthegOinOz’s picture

bump

PedroMiguel’s picture

I also want this feature. (Im at very beginner level at drupal dev, so its impossible to me....)

pixelsweatshop’s picture

+1 feature

nigelw’s picture

sub

Anonymous’s picture

I want this too

OnthegOinOz’s picture

seems like a pretty consistent message here!

lets hope it gets noticed or is already in the pipeline for coming versions

Anonymous’s picture

my back-end wizard installed the Custom Subscriptions module and we have made that work in the meantime - but it doesn't work quite the same way so the user interface is a little clunky. It will do in the meantime, but I still would like a smoother solution.

OnthegOinOz’s picture

Hi hbecker,

I'm wondering if you could explain a little further about what functionality you've achieved, especially in relation to linking content types to taxonomy terms for subscriptions?

thanks, and good on you for working out a basic way around it.... i really hope some of the crew form the Notifications module development team are seeing this thread!

crantok’s picture

I feel like I'm part way there so wanted to just mention what I'd done in case it would help anyone else.

Rather than a content type + taxonomy term combination, I wanted an OG group + taxonomy term combination. I wrote the following implementation of hook_notifications in a new module. It specifies 'fields' that are defined in the notifications_tags module and the og_notifications module. Presumably you could replace array( 'tid', 'group' ) with array( 'tid', 'type' ).

function my_module_notifications($op, &$arg0 = NULL, $arg1 = NULL, $arg2 = NULL) {
 
  switch ($op) {
    case 'subscription types':
      $sub_types['group-term'] = array(
         'event_type' => 'node',
         'title' => t('Group term'),
         'description' => t('Subscribe to posts, in a given Group, tagged with a particular Term.'),
         'access' => 'subscribe to group term',  // define this permission in hook_perm()
         'fields' => array( 'tid', 'group' ),
      );
      return $sub_types;
  }
}

What does this get you?

Well on these admin pages you can enable the new subscription type "Group term":

  • /admin/messaging/notifications/subscriptions
  • /admin/messaging/notifications/subscriptions/content
  • /admin/messaging/notifications/subscriptions/ui

and a user can create such a subscription here:

  • users/%/notifications/add/group-term

What don't you get?

This is not enough to actually create a notification when an event occurs that complies with a user defined subscription of this type. I'm missing something. I think the answer may lie in hook_notifications_event, or possibly hook_notifications_object_node, or hook_notifications_subscription. I see all these hooks called when I create a node with the given taxonomy term in the given group. If anyone could point me towards some documentation on these hooks I would be really grateful.

OnthegOinOz’s picture

looks interesting crantok... i am certainly no coder but it makes sense the direction you're going.

I am wondering whether this Content Taxonomy module has any benefit? http://drupal.org/project/content_taxonomy

crantok’s picture

@caminoz74 That module gives you access to a CCK field for selecting a taxonomy term. It's not directly related to your issue. If your issue is solved then it should work with both an associated vocabulary or a Content Taxonomy field.

@Anyone I've submitted a new issue as a more generic support request, similar to my previous comment, here #1091846: How to implement a new subscription type from existing fields?

OnthegOinOz’s picture

@crantok, unforetunately then my issue is not solved. Essentially I want want you want but tied to any content type, not just organic group content.

Anonymous’s picture

Hi, sorry to be absent for so long ...
I don't have subscriptions tied to taxonomy terms - I still want that.

crantok’s picture

Version: 6.x-4.x-dev » 6.x-4.0-beta7

I've succeeded in defining a subscription type for content tagged with a given taxonomy term and posted in a given organic group. I've made the module available via my drupal.org sandbox. It's very rough at the moment and definitely not fit for production sites, but it works.

You could do the same for content of a given type tagged with a given taxonomy term.

This has been a learning experience for me, as part of which I wrote these example modules to help me get to grips with the Notifications system. They are very heavily commented so they might help someone trying to define their first subscription type. Please note that I am still no expert on the Notifications system and I expect that an example module written by someone who was would look very different :)