Hello everyone!
I’m having trouble importing a variable into a widget, specifically a checkbox widget where I want the CHECK_AS_SWITCH
variable to change the checkbox to a switch when it’s True
. I created the following checkbox.html
:
{% load djbs_extras %}
{% if djbs.CHECK_AS_SWITCH %}
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault">
</div>
{% else %}
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
</div>
{% endif %}
However, the variable is not being loaded properly. Can anyone help? The variable is working because I’ve tested it with some requests, and it’s returning True
as expected.