Created
May 13, 2012 14:57
-
-
Save gabrielnau/2688818 to your computer and use it in GitHub Desktop.
Locomotive CMS book / Templating / Templating logic / Going further / Several layouts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends alternate_layout %} | |
{% block alternate_content %} | |
the content of alternate page, using the layout defined in alternate_layout.liquid.html | |
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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