use node id in code field of Display suite module
hi to all,
I want to use the NID to check if the current node has a certain value for a field, but I can not read it.
CODE:
$nid=???????????????????????????????
$node = node_load($nid);
if ($node->my_field[LANGUAGE_NONE][0]['value'] == 'value') { ... }
if i put a fixed value for $nid var, the code work very well, but i want the current node nid.
you can help me??

Risposte
Ciao, perchè hai postato in
Ciao, perchè hai postato in inglese :-D?
Se ti trovi in una pagina di tipo node/X puoi usare la funzione arg() per estrarre l'id, ad esempio:
<?php$nid = (arg(0) == 'node' && is_numeric(arg(1)) ? arg(1) : NULL);
?>