Hello

To generate my block, i use NodeBlock module. So i create a content with my content type NodeBlock and a block is automaticaly created.

I create a template suggestion block--nodeblock.tpl.php.

To get and see variables i want to use in my template suggestion block--nodeblock.tpl.php, I use dsm($block).

"dsm" returns a lot of variables and i don't know how to get a variable. I'm simplifying below the tree to get the variable : "css_bck_red"

#node (Object) stdClass 
     field_css_color_background_box (Array, 1 element) 
           und (Array, 1 element) 
                 0 (Array, 3 elements) 
                      value (String, 11 characters )  
                               css_bck_red

I tried $block->["#node"]->field_css_color_background_box['und'][0]->value or $block->field_css_color_background_box['und'][0]->value but it doesn't work

Thank you very much for your help !

Comments

evets33 created an issue. See original summary.

evets33’s picture

Assigned: evets33 » Unassigned
evets33’s picture

Assigned: Unassigned » evets33

Answer :

$block->{'#node'}->field_css_color_background_box['und'][0]['value']

Johnny vd Laar’s picture

Status: Active » Closed (works as designed)