Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By vladimirkomarek on
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
Change this:
Change this:
To this:
nope
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
just to be clear
this perfectly works