Check in header file if lightswitch field is on For a menu I have to check if a lightswitch field is on or not. The menu is in an extra header file. I've tried:

{% if craft.entries.section('aboutus').lightswitch_field %}style="display: none;"{% else %} ... {% endif %}


but this always jumps into the else part.
Try:

if craft.entries.section('aboutus').lightswitch_field('1')|length


If you want to check if it is "off" use:

if craft.entries.section('aboutus').lightswitch_field('not 1')|length