Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello!
My site is www.faithandyou.in
There is a custom cellections liquid file i have on my site.
It loops and autoplays the categories every 2.5 seconds but i need help.
The collection list is too tiny on mobile
And on desktop the images get cut off on the right side
This is my custom-collection-list.liquid! HOW CAN WE FIX THIS???
{{ 'section-collection-list.css' | asset_url | stylesheet_tag }} {{ 'component-card.css' | asset_url | stylesheet_tag }} {{ 'component-slider.css' | asset_url | stylesheet_tag }} {%- style -%} .section-{{ section.id }}-padding { padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px; padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px; } @media screen and (min-width: 750px) { .section-{{ section.id }}-padding { padding-top: {{ section.settings.padding_top }}px; padding-bottom: {{ section.settings.padding_bottom }}px; } } {%- endstyle -%} {%- liquid assign columns_mobile_int = section.settings.columns_mobile | plus: 0 assign show_mobile_slider = false if section.settings.swipe_on_mobile and section.blocks.size > columns_mobile_int assign show_mobile_slider = true endif -%} <!-- Link Swiper's CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" /> <style> .mySwiper { padding-bottom: 30px; } .mySwiper .swiper-button-prev, .mySwiper .swiper-button-next { display: block; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: white; color: black; } .mySwiper .swiper-button-prev::after, .mySwiper .swiper-button-next::after { font-size: 22px; } .mySwiper .swiper-pagination .swiper-pagination-bullet { width: 15px; height: 15px; background: #d07e13; } </style> <div class="color-{{ section.settings.color_scheme }} gradient grid--{{ section.settings.columns_desktop }}-col-desktop"> <div class="collection-list-wrapper isolate{% if show_mobile_slider %} page-width-desktop{% endif %}{% if section.settings.title == blank %} no-heading{% endif %}{% if section.settings.show_view_all == false or section.blocks.size > collections.size %} no-mobile-link{% endif %} section-{{ section.id }}-padding"> {%- unless section.settings.title == blank -%} <div class="title-wrapper-with-link{% if show_mobile_slider %} title-wrapper--self-padded-tablet-down{% else %} title-wrapper--self-padded-mobile{% endif %} title-wrapper--no-top-margin"> <h2 id="SectionHeading-{{ section.id }}" class="collection-list-title inline-richtext {{ section.settings.heading_size }}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" > {{ section.settings.title }} </h2> {%- if section.settings.show_view_all and show_mobile_slider -%} <a href="{{ routes.collections_url }}" id="ViewAll-{{ section.id }}" class="link underlined-link large-up-hide{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" aria-labelledby="ViewAll-{{ section.id }} SectionHeading-{{ section.id }}" > {{- 'sections.collection_list.view_all' | t -}} </a> {%- endif -%} </div> {%- endunless -%} {% comment %} <slideshow-component class="slider-mobile-gutter slider-component-desktop {% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}"> <ul class="slideshow slider slider--everywhere custom-collection-listing collection-list contains-card contains-card--collection{% if settings.card_style == 'standard' %} contains-card--standard{% endif %} grid grid--{{ section.settings.columns_desktop }}-col-desktop grid--{{ section.settings.columns_mobile }}-col-tablet-down{% if section.settings.swipe_on_mobile %} slider slider--tablet grid--peek{% endif %} collection-list--{{ section.blocks.size }}-items" id="Slider-{{ section.id }}" role="list" > {%- liquid assign columns = section.blocks.size if columns > 3 assign columns = 3 endif -%} {%- for block in section.blocks -%} <li id="Slide-{{ section.id }}-{{ forloop.index }}" class=" slideshow__slide slider__slide grid__item{% if show_mobile_slider %} slider__slide{% endif %}{% if block.settings.collection.featured_image == nil %} collection-list__item--no-media{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" {{ block.shopify_attributes }} {% if settings.animations_reveal_on_scroll %} data-cascade style="--animation-order: {{ forloop.index }};" {% endif %} > {%- assign placeholder_image_index = forloop.index0 | modulo: 4 | plus: 1 -%} {%- assign placeholder_image = 'collection-apparel-' | append: placeholder_image_index -%} {% render 'custom-card-collection', card_collection: block.settings.collection, card_collection_image: block.settings.card_collection_image, media_aspect_ratio: section.settings.image_ratio, columns: columns, placeholder_image: placeholder_image %} </li> {%- endfor -%} </ul> <div class="slider-buttons no-js-hidden"> <div class="slider-counter caption"> <span class="slider-counter--current">1</span> <span aria-hidden="true"> / </span> <span class="visually-hidden">{{ 'general.slider.of' | t }}</span> <span class="slider-counter--total">{{ products_to_display }}</span> </div> <div class="slider-button-button"> <button type="button" class="slider-button slider-button--prev" name="previous" aria-label="{{ 'sections.slideshow.previous_slideshow' | t }}" aria-controls="Slider-{{ section.id }}" > {% render 'icon-caret' %} </button> <button type="button" class="slider-button slider-button--next" name="next" aria-label="{{ 'sections.slideshow.next_slideshow' | t }}" aria-controls="Slider-{{ section.id }}" > {% render 'icon-caret' %} </button> </div> </div> {%- if show_mobile_slider -%} <div class="slider-buttons no-js-hidden"> <button type="button" class="slider-button slider-button--prev" name="previous" aria-label="{{ 'general.slider.previous_slide' | t }}" > {% render 'icon-caret' %} </button> <div class="slider-counter caption"> <span class="slider-counter--current">1</span> <span aria-hidden="true"> / </span> <span class="visually-hidden">{{ 'general.slider.of' | t }}</span> <span class="slider-counter--total">{{ section.blocks.size }}</span> </div> <button type="button" class="slider-button slider-button--next" name="next" aria-label="{{ 'general.slider.next_slide' | t }}" > {% render 'icon-caret' %} </button> </div> {%- endif -%} </slideshow-component> {% endcomment %} <div class="swiper mySwiper"> <ul class="swiper-wrapper" id="Slider-{{ section.id }}" role="list" > {%- liquid assign columns = section.blocks.size if columns > 3 assign columns = 3 endif -%} {%- for block in section.blocks -%} <li id="Slide-{{ section.id }}-{{ forloop.index }}" class="swiper-slide custom-slider-slide grid__item{% if block.settings.collection.featured_image == nil %} collection-list__item--no-media{% endif %}" {{ block.shopify_attributes }} > {%- assign placeholder_image_index = forloop.index0 | modulo: 4 | plus: 1 -%} {%- assign placeholder_image = 'collection-apparel-' | append: placeholder_image_index -%} {% render 'custom-card-collection', card_collection: block.settings.collection, card_collection_image: block.settings.card_collection_image, media_aspect_ratio: section.settings.image_ratio, columns: columns, placeholder_image: placeholder_image %} </li> {%- endfor -%} </ul> <div class="swiper-button-next"></div> <div class="swiper-button-prev"></div> <div class="swiper-pagination"></div> </div> {%- if section.settings.show_view_all and section.blocks.size < collections.size -%} <div class="center collection-list-view-all{% if show_mobile_slider %} small-hide medium-hide{% endif %}{% if settings.animations_reveal_on_scroll %} scroll-trigger animate--slide-in{% endif %}" {% if settings.animations_reveal_on_scroll %} data-cascade {% endif %} > <a href="{{ routes.collections_url }}" class="button" id="ViewAllButton-{{ section.id }}" aria-labelledby="ViewAllButton-{{ section.id }} SectionHeading-{{ section.id }}" > {{- 'sections.collection_list.view_all' | t -}} </a> </div> {%- endif -%} </div> </div> <!-- Swiper JS --> <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script> <script> var swiper = new Swiper(".mySwiper", { slidesPerView: 4, spaceBetween: 1, autoplay: { delay: 2500, disableOnInteraction: false, }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, pagination: { el: ".swiper-pagination", clickable: true, }, }); </script> {% schema %} { "name": "Custom collection list", "tag": "section", "class": "section section-collection-list custom-collection-list", "max_blocks": 15, "disabled_on": { "groups": ["header", "footer"] }, "settings": [ { "type": "inline_richtext", "id": "title", "default": "Collections", "label": "t:sections.collection-list.settings.title.label" }, { "type": "select", "id": "heading_size", "options": [ { "value": "h2", "label": "t:sections.all.heading_size.options__1.label" }, { "value": "h1", "label": "t:sections.all.heading_size.options__2.label" }, { "value": "h0", "label": "t:sections.all.heading_size.options__3.label" } ], "default": "h1", "label": "t:sections.all.heading_size.label" }, { "type": "select", "id": "image_ratio", "options": [ { "value": "adapt", "label": "t:sections.collection-list.settings.image_ratio.options__1.label" }, { "value": "portrait", "label": "t:sections.collection-list.settings.image_ratio.options__2.label" }, { "value": "square", "label": "t:sections.collection-list.settings.image_ratio.options__3.label" } ], "default": "square", "label": "t:sections.collection-list.settings.image_ratio.label", "info": "t:sections.collection-list.settings.image_ratio.info" }, { "type": "range", "id": "columns_desktop", "min": 1, "max": 7, "step": 1, "default": 3, "label": "t:sections.collection-list.settings.columns_desktop.label" }, { "type": "color_scheme", "id": "color_scheme", "label": "t:sections.all.colors.label", "info": "t:sections.all.colors.has_cards_info", "default": "scheme-1" }, { "type": "checkbox", "id": "show_view_all", "default": false, "label": "t:sections.collection-list.settings.show_view_all.label" }, { "type": "header", "content": "t:sections.collection-list.settings.header_mobile.content" }, { "type": "select", "id": "columns_mobile", "options": [ { "value": "1", "label": "t:sections.collection-list.settings.columns_mobile.options__1.label" }, { "value": "2", "label": "t:sections.collection-list.settings.columns_mobile.options__2.label" } ], "default": "1", "label": "t:sections.collection-list.settings.columns_mobile.label" }, { "type": "checkbox", "id": "swipe_on_mobile", "default": false, "label": "t:sections.collection-list.settings.swipe_on_mobile.label" }, { "type": "header", "content": "t:sections.all.padding.section_padding_heading" }, { "type": "range", "id": "padding_top", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_top", "default": 36 }, { "type": "range", "id": "padding_bottom", "min": 0, "max": 100, "step": 4, "unit": "px", "label": "t:sections.all.padding.padding_bottom", "default": 36 } ], "blocks": [ { "type": "featured_collection", "name": "t:sections.collection-list.blocks.featured_collection.name", "settings": [ { "type": "collection", "id": "collection", "label": "t:sections.collection-list.blocks.featured_collection.settings.collection.label" }, { "type": "image_picker", "id": "card_collection_image", "label": "Image", "info": "Image sizes to 1080 x 1080 pixels" } ] } ], "presets": [ { "name": "Custom collection list", "blocks": [ { "type": "featured_collection" }, { "type": "featured_collection" }, { "type": "featured_collection" } ] } ] } {% endschema %} {% render "custom-collection-list-css", section_id:section.id %}
Hi @AryavK
@media screen and (max-width: 768px){
li.swiper-slide.custom-slider-slide.grid__item {
width: 23% !important;
}
}
Hi daisy. Thanks for replying so fast!
But the code did not work tho. What i want is that to make the pics on mobile to get larger.
Hi @AryavK
For this task, please follow these steps:
Create Two Blocks:
Adjust the Width:
I hope this helps
Best,
Daisy
Hi! Thanks. This helps a lot but I cant understand how to do it. Can you please provide the code to be added + where it should be added _ the code to change.
TYSM!