Using a Lightswitch to insert a class on a body's tag
Lightswitch fields save an integer to the database:

This integer can be checked just like a boolean, with Twigs if-tag:

&lt;body class='{% if lightswitch_field_handle %}class_name{% endif %}'&gt;



  1 = true  = on
  0 = false = off


.

Twig has also a ternary operator which is similar to php's ternary operator:

&lt;body class="{{ lightswitch_field_handle ? 'class_name' }}"&gt;

&lt;body class="{{ lightswitch_field_handle ? 'class_name' : 'alt_class_name' }}"&gt;




Answer to Edit 1:

Your example doesn't work because you aren't comparing: if value == 1, you are checking a function: if function(param) == true. Check out the Twig if documentation for more examples.

If entry.whiteText doesn't work, your section doesn't have such a field. If you added it to your main template, you should check if the field is defined.