Loop divisible by issue
Forgive me if I'm wrong... by using loop.index0 is divisible by(2) are you trying to determine if the instance is odd or even?


1st - returns false
2nd - returns true
3rd - returns false
4th - returns true


If so Twig does support checking if the loop index is even or odd. Perhaps that would be better to use?

{% if loop.index is even %}Even{% endif %}


EDIT

I've just had a read of the Craft docs for the Case and Switch tags and found this:


  If you’re using the {% switch %} tag inside of a {% for %} loop, you won’t be able to access Twig’s loop variable directly inside of the {% switch %} tag. Instead, you can access it like so:


{% for matrixBlock in entry.matrixField %}
    {% set loopIndex = loop.index %}

    {% switch matrixBlock.type %}

        {% case "text" %}

            Loop #{{ loopIndex }}

    {% endswitch %}
{% endfor %}