Creazione Nodo con tassonomia

3 contenuti / 0 new
Ultimo contenuto
Creazione Nodo con tassonomia

Ciao a tutti,
mi sto servendo delle seguenti istruzioni per inserire un nodo.

[code]

$node = new stdClass();
$node->type = 'product';

node_object_prepare($node); // This sets up all the default node fields so we don't accidentally leave something off.

// Copy over all the existing settings from Drupal 5.
$node->uid = 1;
$node->title = $_POST["NomeProdotto"]

// Set Ubercart variables
$node->model = "sal1010";//$_POST["CodiceArticolo"]; // the SKU is a required field, so I generated a SKU based on the node title
$node->sell_price = "5.00" //$_POST["Prezzo"];
$node->default_qty = 1;
$node->weight_units = "pz";

// Set taxonomy + menu etc if you need to
$node->taxonomy = array();
$node->menu = array();

// Save the node
node_save($node); // This will update the $node object with the $node->nid which is important for the next step.

[/code]

Però ciò che non capisco è come posso associargli la Tassonomia...

devo indicargli l'ID? o forse il vid? Oppure un array di che cosa?

Grazie a tutti!

Drupal Version:

Nessuno che mi sappia aiutare???

Dai non ci credo che nessuno ha avuto questo stesso mio problema... :(

Ma si dai, il web è pieno :)
http://drupal.stackexchange.com/questions/40024/insert-new-term-as-tag-o...

Però ci sei quasi, waw!
$node = new StdClass();
.......
.......
.......
$node->taxonomy =
array (
'tags' =>
array (
1 => 'Beer,Becks',
)
);
$node = node_submit($node);
node_save($node);

Ciao