I have a need and haven't been able to find a solution yet. Here it is :
Every time a new term of a specific vocabulary is created, I want to automatically create a node associated to that term of taxonomy.
For that, I have used Rules on Drupal 6 and it works perfectly :
Event is "After saving a new term", Action is "Add new content", 2nd action is "Assign a term to content".
My problem is that this rules is applied to all terms of all vocabularies whereas I would like to assign it to only one vocabulary.
I'd like to use "Conditions" but I don't have a condition such as "Term is part of vocabulary" and I didn't manage to do it in PHP.
Did I miss a feature ? Could any one help ?
Thank you for your help.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | term_in_vocab_condition-912072-5.patch | 2.17 KB | chaps2 |
Comments
Comment #1
TS79 commentedplease have a look to #490898: Condition: does term exist?
Comment #2
itangalo commentedClosing this issue, as of comment by master-of-magic.
Comment #3
g76 commentedA possible alternative: Taxonomy Node Module. Use default field settings in node type and even combine with editablefields module.
http://drupal.org/project/taxonomy_node
http://drupal.org/project/editablefields
Comment #4
chaps2 commentedIt is possible to test the vocabulary of a loaded term using #490808: a problem using Feedback module by entering the term name token in the field titled "Enter the name of the term" - e.g. [term:cat-raw]. However that isn't the intended purpose of #490808: a problem using Feedback module and using it to test the vocabulary of a loaded term is not intuitive.
A separate condition is needed for this.
Comment #5
chaps2 commentedAttached patch adds a "Term in vocabulary" condition which is what @baudelot and myself require.
Comment #7
calefilm commentedthe thread mentioned in #1: "#490898: Condition: does term exist?" did not resolve my issue. I applied the patch in #40 but I still have the same problem with creating aliases.
I've created a Taxonomy Term that I'm using in Rules "Create Alias" but it won't allow me to reference the vocabulary of the created term.
I create Taxonomy Term: Starbucks
Vocabulary is Company
I go to rules:
if i apply patch I add Condition: Load Term (select Vocabulary)
Action: Create or Delete Alias
existing path: company/[term:tid]
path alias: [term:cat-description]
The result is every term in all vocabularies are affected, not just the Company Vocabulary. What can I input in my php code that will only select "Company Vocabulary"?
Thank you.
Comment #8
calefilm commentedMY WORKAROUND:
Event:
After Updating a Term
Condition:
URL Alias exists
-path alias: category/company/[term:cat-raw]
Action:
Create or Delete Alias
existing path: company/[term:tid]
path alias: [term:cat-description]
Comment #9
mitchell commentedUpdated component.
Comment #10
alanom commentedThere's a way to do this, but it's a little fiddly and unintuitive: it's surprising that it isn't supported more cleanly in Rules core, since taxonomy vocabularies have been a core drupal feature since the mists of time.
So for example, if you want a rules action to happen when terms in a specific vocabulary are created, edited or deleted:
This works. It's a good idea to double-check it behaves as expected by creating a temporary "Show a message on the site" action for the rule, so you can clearly and safely see when it is and isn't being applied