Skip to content

Instantly share code, notes, and snippets.

@adrianhardy
Last active July 25, 2016 13:39
Show Gist options
  • Save adrianhardy/69eb3bbb643d2feca075570316fdc76b to your computer and use it in GitHub Desktop.
Save adrianhardy/69eb3bbb643d2feca075570316fdc76b to your computer and use it in GitHub Desktop.
# layout.html.twig
<!doctype html>
<html>
<head></head>
<body>
{% block body %}{% endblock %}
{% block footer_javascript %}{% endblock %}
</body>
</html>
-----------------------------------------
# page.html.twig
{% extends 'layout.html.twig' %}
{% block body %}
<h1>The Page</h1>
{% include entity.which.contains.twigFilePath %}
{% endblock %}
{% block footer_javascript %}
<script type="text/javascript" src="/some/cdn/thing"></script>
{% endblock %}
-----------------------------------------
# twigFilePathSomewhere.twig #
{{ how can this file push something to a block defined in page.html.twig, or lahyout.html.twig }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment