Hi there,
I have following structure:
Category
- term 1
- term 2
- term 3
- term 4
- term 5
I have to hide term 5 from the subscriptions page, but I cannot delete the term, as I need the term for another part of the site.
Could anybody give me a hint how to do that? (except jQuery)
Thank you.
Edit:
hiding some terms via css would be a workaround, but it is quite tedious, as the elements on this page have no ids which I could target.
Feature request:
Could make following change (in pseudo code)?
|legend class="vocabulary" id="name of vocabulary"| Name of Vocabulary |/legend|
|tr class="term" id="name of vocabulary + name of term1" |term1 |/tr|
|tr class="term" id="name of vocabulary + name of term2" |term2 |/tr|
So I could target a single term pretty easy and style it or even set its display on "none".
The module "webform" does so - and even it got some problem, as it does generate non-valid ids sometimes, its better than nothing.
Comments
Comment #0.0
balabushka commentedEdit: idea:hide by css -> needs ids for terms
Comment #1
salvisCSS won't help you here, because Subscriptions deals with text, not HTML.
Your best bet is to write a small module, implement hook_subscriptions_queue_alter(), and set $event to NULL if you see the bad term.
Comment #2
balabushka commentedActually, I have never implemented a hook or written a module, so I just begin to read and dive into the code of the subscriptions module.
Before I get into the wrong direction: hook_subscriptions_queue_alter sounds like a function, that manipulates the subscription queue.
I look for a way to hide one taxonomy term from the users subscriptions overview page.
Now:
taxonomy vocabulary
- term 1
- term 2
- term 3
- term 4
Goal:
taxonomy vocabulary
- term1
- term2
- term3
Is hook_subscriptions_queue_alter really the right entry point?
Thank you.
//edit: I made a quick workaround. Create a new vocabulary "Archive" - in phpmyadmin in table term_data change vid value to according value of "Archive"
On subscription admin page set "Archive" to "omitted vocabularies".
I also tried the "right way" - I created a module, but see above, I have no clue into which function I should hook.
This should be a one or two liner - Salvis, if you have a good day, maybe you could write it out in full (for tid = 4) :-)
Ty in advance
Comment #3
salvisOh, sorry, I misunderstood. I thought you meant to drop notifications for certain terms, as they were about to be queued.
If I understand correctly now, you're looking for a mechanism like "Omitted vocabularies," but for terms. That doesn't exist in Subscriptions, not even in the form of a suitable hook.
You'd have to try the standard Drupal mechanism of hook_form_alter() to remove the term from the form array (see Form API) before it's rendered. This is certainly more involved than just a one-liner.
Comment #4
salvisAssuming this has been solved in the meantime.
Comment #5.0
(not verified) commentededit: lt and gt was not shown, replaced with |