I've failed to get my head around this and hope someone can give me some pointers!
I want to copy content taxonomy field values from a referenced node of the same type.
This is my best (confused!) attempt so far:
1. Load a referenced node.
This works fine - I can copy text (and other) field values OK.
2. Load a vocabulary.
I'm not confident that I need to do this but I'm loading the vocabulary used for the content taxonomy field.
3. Load a term.
This is something I'm trying in desperation without any understanding. I'm doing "Select by term id", using the token [referenced_node:field_taxonomy-tid] where field_taxonomy is the content taxonomy field in question.
4. Populate a field.
At this point I don't have a clue. I've tried a few things with php snippets such as,
return array(
0 => array('tid' => [referenced_node:field_taxonomy-tid]),
);
Also the same with [referenced_node:field_taxonomy-term-raw], and using 'value' and 'term' instead of 'tid', but without any success.
Can anyone help or point me to somewhere that might help?
An additional problem is that once I've got this sorted for a single-term taxonomy I need to handle a multiple-term one!
Comments
Comment #1
nickrice commentedI am making some progress with this. Part of that progress was to realise I understood things even less than I thought!
I'll update things here when I've got my head around enough to write something.
If I really get on top of it maybe I'll even write a short tutorial!
Comment #2
nickrice commentedI've now managed to do what I wanted and have learnt stuff on the way.
So am closing this and opening a new issue with a tutorial at http://drupal.org/node/656574.
Comment #3
nickrice commentedComment #4
Alex Andrascu commentedIs it possible to copy a taxonomy term from a referenced node ? I can set the author of the curent content to be the same as the referenced content but i just can't copy the taxonomy terms from another node. Please help
Comment #5
Alex Andrascu commentedComment #6
Alex Andrascu commentedsorry...i've managed to do it myself