i made my own module to hide a boolean when its value is "0"
but something won't work

this is the code

function MYTHEME_node_view($node, $view_mode, $langcode) {
if($node->content['field_members_only']['#items']['0']['value']=="0") {
                      hide($node->content['field_members_only']); 
                    }
}

sorry for the newbie question

Comments

Jaypan’s picture

Change this:

hide($node->content['field_members_only']); 

To this:

$node->content['field_members_only']['#access'] = FALSE;
vladimirkomarek’s picture

keep printing:
Notice: Undefined index: field_members_only in komarek_node_view() (line 41 of

actually the problem is in the IF condition... because the statement perfectly works without the condition (hides the field)

thanks

vladimirkomarek’s picture

function komarek_node_view($node, $view_mode, $langcode) {

                      hide($node->content['field_members_only']); 

}

this perfectly works