Template “layouts/.html.twig” is not defined in “default.html.twig” at line 12.

I am using the statement include for dynamic sections in MODx.

It was working fine so far, but today I received the following exception that basically means, my snippet tried to include a file that doesn’t exist. The variableĀ classes was empty that causesĀ a broken website.

In my case I improved my snippet with an if condition.