Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
AJAX conditional layout, This is useful if you planing to get only the content of a page or content type via AJAX, by calling a bare bones layout.
{# Extend a different layout if requested via AJAX #}
{% extends app.request.isXmlHttpRequest ? 'layout-ajax.twig' : 'layout.twig' %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment