Skip to content

Instantly share code, notes, and snippets.

@Mozu-CS
Last active December 14, 2015 21:27
Show Gist options
  • Save Mozu-CS/f61fa731cdb6f86236f7 to your computer and use it in GitHub Desktop.
Save Mozu-CS/f61fa731cdb6f86236f7 to your computer and use it in GitHub Desktop.
Example of the homepage template with added make_url tag for CDN resizing
.homepage-template {
display: block;
img {
display: block;
max-width: 100%;
}
}
{% extends "page" %}
{% block body-tag-classes %}
homepage-template
{% endblock body-tag-classes %}
{% block body-content %}
{# Homepage Slide show #}
<div class="slideshow-container">
<ul class="slideshow-wrapper">
<li class="slide">
<img src="{{ make_url "image" model.slideshowImgUrl with maxWidth=2400 quality=35 as_parameter }}" alt="">
</li>
...
</ul>
</div>
{# Featured Categories #}
<div class="featured-categores-container">
<div class="row">
<div class="col ">
<img src="{{ make_url "image" model.featuredCategoryImage with maxWidth=1200 quality=35 as_parameter }}" alt="">
</div>
...
</div>
</div>
{# Featured Products #}
<div class="featured-products-carousel">
<ul class="featured-products-carousel-wrapper">
<li class="slide">
<img src="{{ make_url "image" model.featuredProductImage with maxWidth=600 quality=35 as_parameter }}" alt="">
</li>
...
</ul>
</div>
{% endblock body-content %}
// Slide show:
<img src="{{ make_url "image" model.slideshowImgUrl with maxWidth=2400 quality=35 as_parameter }}" alt="">
// Featured Categories:
<img src="{{ make_url "image" model.featuredCategoryImage with maxWidth=1200 quality=35 as_parameter }}" alt="">
// Featured Products:
<img src="{{ make_url "image" model.featuredProductImage with maxWidth=600 quality=35 as_parameter }}" alt="">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment