1
votes

Is it possible with Rules to set the numeric weight value of a taxonomy term as a CCK field when a node is saved?

I have 2 taxonomy vocabularies, and all nodes of a certain content type will have 1 term from each vocabulary. When not on the term's page, I need the sort order of nodes in a View to be by the term's weight. I therefore need to access the term's weight as a CCK field, so Views can use the value as a sort order. Can this be done with Rules?

1

1 Answers

0
votes
  1. You don't need to save the term weights in the node. In the view-sort option select term-weight from Taxonomy. or you can also select the row style as table and then select the field, taxonomy-terms all(you can filter by vocabulary also) from the taxonomy group and then sort the table based on that field.
  2. If you really want to save the terms, then you don't necessarily need Rules for that and content-taxonomy might do the trick for you. And then you can sort your view by that field.

EDIT : 2 . Add a custom-php-field in the views and write something like

return taxonomy_term_load($my_tid)->weight; And then sort the view by this field.