Active
Project:
Taxonomy Defaults
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Jan 2011 at 17:46 UTC
Updated:
11 Jan 2011 at 19:06 UTC
Hallo,
I'm using taxonomy_defaults on 27 sites, and it would be very handy for me to be able to:
by deploying a php script via drush. It seems to me that I could accomplish both by setting the involved variables by:
<?php
variable_set("taxdef_mytype_5_visible", FALSE);
variable_set("taxdef_mytype_5", 20);
?>where 5 and 20 are vid and tid respectively. Do you think this is going to work? Do I have to invoke any module before that?
Also, is there a way to retroactively assign a term to already created nodes? I could modify the node_term table, but I'm hoping there is a less brutal solution...
Thanks in advance,
L.F.
Comments
Comment #1
bradweikel commentedI can't speak to the Drush side of this, since I've not written any drush commands (although it looks pretty straightforward according to the sandwich example on the Drush project page), but in terms of the Taxonomy Defaults that looks about right, although the term id should actually be in an array:
As for retroactive assignment, you could use the Views Bulk Operation module to avoid direct SQL wrangling, but I've steered clear of retroactive stuff in the Taxonomy Defaults module because I don't want to bloat the module with a bunch of different configuration options for those sorts of changes.
If you get a full drush command put together, will you attach it to this issue? I'm sure others will be interested...
Comment #2
lucio.ferrari commentedI only tried this using devel module's "Execute PHP Code" block, but it seems to work.
My aim is to create a vocabulary with only one term, hide the vocabulary and set the term as default.
This will be used in conjunction with 'nodeorder' module and a view to order posts promoted to front page (the part involving nodeorder seems to be not so easily automatized, unfortunately...)
I'll execute this code as:
drush -r /path/to/root -l http://www.example.ch scr script.phpThen, I guess I'm going to brutalize the database to add the tid of 'Front page' to nodes as needed.