Is it possible to call a variable within a tag pair? Having already defined foo, I tried this:

{% for block in availability.{{ foo }} %}


This gives error:

Expected name or number


Can anyone please tell me the right way to go about this.
Try this:

{% for block in availability[foo] %}


The square brackets let you access a variable variable name on an object.

As a general rule you never put {{ }} inside of {% %} tags in twig.