Skip to content

Instantly share code, notes, and snippets.

@gabrielnau
Created May 13, 2012 14:57
Show Gist options
  • Save gabrielnau/2688818 to your computer and use it in GitHub Desktop.
Save gabrielnau/2688818 to your computer and use it in GitHub Desktop.
Locomotive CMS book / Templating / Templating logic / Going further / Several layouts
<html>
<head>
<title>The Alternate Layout</title>
</head>
<body>
<header>
Alternate header
</header>
<div id="content">
{% block alternate_content %}
the content of the alternate layout page, it can be empty if you just want to define an empty layout
{% endblock %}
</div>
<footer>
Alternate footer
</footer>
</body>
</html>
{% extends alternate_layout %}
{% block alternate_content %}
the content of alternate page, using the layout defined in alternate_layout.liquid.html
{% endblock %}
<html>
<head>
<title>The Main Layout</title>
</head>
<body>
<header>
Main header
</header>
<div id="content">
{% block main_content %}
the content of the index page
{% endblock %}
</div>
<footer>
Main footer
</footer>
</body>
</html>
{% extends parent %}
{% block main_content %}
the content of the normal page
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment