Skip to content

Instantly share code, notes, and snippets.

@havvg
Created September 21, 2012 09:59
Show Gist options
  • Save havvg/3760712 to your computer and use it in GitHub Desktop.
Save havvg/3760712 to your computer and use it in GitHub Desktop.
Twig embed with Twitter Bootstrap page layouts
<div class="row-fluid">
{% if content_width is not defined %}
{% set content_width = 8 %}
{% endif %}
<div class="span{{ content_width }}">
{% block content %}{% endblock %}
</div>
{% if sidebar_width is not defined %}
{% set sidebar_width = 4 %}
{% endif %}
<div class="span{{ sidebar_width }} sidebar">
{% block sidebar %}{% endblock %}
</div>
</div>
{% embed ":Layout:content_with_sidebar.html.twig" with { 'content_width': 7, 'sidebar_width': 5 } %}
{% block content %}
.. your content ...
{% endblock %}
{% block sidebar %}
.. your sidebar ...
{% endblock %}
{% endembed %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment