Skip to content

Instantly share code, notes, and snippets.

@zomars
Created August 17, 2015 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zomars/223b3a912f920dfbf3b8 to your computer and use it in GitHub Desktop.
Save zomars/223b3a912f920dfbf3b8 to your computer and use it in GitHub Desktop.
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