Someone sucessfully implemented such part of Twig code?
{% if request.isXmlHttpRequest %}
{% include ":Elements:cufor-font-replacement.html.twig" %}
{% else %}
{% extends "::layout-clean.html.twig" %}
{% endif %}
without seeing:
A template that extends another one cannot have a body
(Twig_Node_Include(only: false expr:
Twig_Node_Expression_Constant(value:
‘:Elements:cufor-font-replacement.html.twig’) variables:)) in
“:Users:create.html.twig” at line 2.
Unfortunately, it is not possible to conditionally extend a template in Twig. You’ll have to create another template that extend “::layout-clean.html.twig” and conditionally include it.