Skip to content

Instantly share code, notes, and snippets.

@rotcl
Created April 4, 2019 17:45
Show Gist options
  • Save rotcl/3d1004b4c4891e8ed605353996c17c21 to your computer and use it in GitHub Desktop.
Save rotcl/3d1004b4c4891e8ed605353996c17c21 to your computer and use it in GitHub Desktop.
Shopify - Banner 1:2
{% comment %}
@rotcl
{% endcomment %}
{% if section.blocks.size > 0 %}
<div class="container">
<div class="row">
{% for block in section.blocks %}
{%- assign image = block.settings.image -%}
{%- assign image2 = block.settings.image2 -%}
{%- assign image3 = block.settings.image3 -%}
{%- assign link = block.settings.link -%}
{%- assign link2 = block.settings.link2 -%}
{%- assign link3 = block.settings.link3 -%}
<div class="two-thirds columns">
<a href="{{ link }}">
<img src="{{ image | img_url: '900x' }}'" alt="" />
</a>
</div>
<div class="one-third columns">
<a href="{{ link2 }}">
<img src="{{ image2 | img_url: '450x' }}'" alt="" />
</a>
<a href="{{ link3 }}">
<img src="{{ image3 | img_url: '450x' }}'" alt="" />
</a>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<style media="all">
img{
max-width:100%;
padding-bottom: 7px;
}
</style>
{% schema %}
{
"name": "Banner Custom ",
"max_blocks": 1,
"blocks": [
{
"type": "image",
"name": "Image slide",
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "Image 1",
"info": "900x600 o proporcional. (3:2)"
},
{
"type": "url",
"id": "link",
"label": "Link 1"
},
{
"type": "image_picker",
"id": "image2",
"label": "Image 2",
"info": "450x300 o proporcional. (3:2)"
},
{
"type": "url",
"id": "link2",
"label": "Link 2"
},
{
"type": "image_picker",
"id": "image3",
"label": "Image 3",
"info": "450x300 o proporcional. (3:2)"
},
{
"type": "url",
"id": "link3",
"label": "Link 3"
}
]
}
],
"presets": [{
"name": "Banner 1:2 ",
"category": "Image",
"blocks": [
{
"type": "image"
}
]
}]
}
{% endschema %}
@rotcl
Copy link
Author

rotcl commented Apr 4, 2019

eCommerce - ⚡️ Shopify ⚡️

Crear sección 1:2-banner.liquid y agregar el código.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment