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.

CommentFileSizeAuthor
#5 term_in_vocab_condition-912072-5.patch2.17 KBchaps2

Comments

TS79’s picture

itangalo’s picture

Status: Active » Closed (duplicate)

Closing this issue, as of comment by master-of-magic.

g76’s picture

A 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

chaps2’s picture

Version: 6.x-1.2 » 6.x-1.4
Status: Closed (duplicate) » Active

It 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.

chaps2’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new2.17 KB

Attached patch adds a "Term in vocabulary" condition which is what @baudelot and myself require.

Status: Needs review » Needs work

The last submitted patch, term_in_vocab_condition-912072-5.patch, failed testing.

calefilm’s picture

the 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.

calefilm’s picture

MY 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]

mitchell’s picture

Component: Miscellaneous » Rules Core

Updated component.

alanom’s picture

Version: 6.x-1.4 » 7.x-2.2

There'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:

  1. Look up the vid value (an integer) of the vocabulary you are interested in, note it down. As far as I can tell, this can only be done by looking it up in vid column in the database's taxonomy vocabulary table
  2. Create your rule, give it the events "After deleting a term", "After saving a new term", "After updating an existing term", as you would expect
  3. Create a condition, "Data comparison". Enter "Term...", then from the resulting wider selection of options, "Term:Vocabulary". In data value, enter the number of the vid of your vocabulary (not the machine name - has to be an integer)

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