Skip to content

Instantly share code, notes, and snippets.

@gabrielnau
Created May 13, 2012 15:32
Show Gist options
  • Save gabrielnau/2688941 to your computer and use it in GitHub Desktop.
Save gabrielnau/2688941 to your computer and use it in GitHub Desktop.
Locomotive CMS book / Templating / Templating logic / Going further / Snippets
<html>
<head>
<title>Snippet example</title>
</head>
<body>
<header>
</header>
<div id="content">
<!-- Loop on products -->
{% for product in contents.products %}
<!-- Include "product_information" snippet with the current product -->
{% include 'product_information' with product %}
{% endfor %}
</div>
{% include 'sidebar' %}
<footer>
</footer>
</body>
</html>
<div class="product">
{{ product.name }} : {{ product.price }}$
</div>
<div id="sidebar">
the sidebar
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment