What's your biggest current challenge? Have your say in Community Polls along the right column.

How to reduce the size of the images in my collection list layout?

Solved

How to reduce the size of the images in my collection list layout?

sukalde
Excursionist
18 0 1

Hello everyone,

 

I am trying to achieve the following layout on my website

sukalde_0-1653426577067.png

 

I tried to copy the same code, but learnt here that it couldn´t be possible. 

So I am trying to accomplish that using my theme´s  code and I got the following result:

 

sukalde_1-1653426653919.png

 

I want to know if I can include some sort of code to make the pictures smaller? and if there´s any way to show those 8 collections in a same row?

 

This is the code I am using in the Mosaic theme:

 

 

<script type="application/pxs-animation-mapping+json">
  {
    "blocks": [".collection--item"],
    "elements": [
      ".collection--item-info"
    ]
  }
</script>

<section class="collection-list--container">
  {% if section.settings.title != blank %}
    <h2 class="home-section--title">
      {{ section.settings.title | escape }}
    </h2>
  {% endif %}

  {% if section.blocks.size > 0 %}
    <ul class="home-section--content collection-list--inner">
      {% for block in section.blocks %}
        {% assign collection = collections[block.settings.collection] %}
        {% assign collection_title = collection.title %}
        {% assign collection_url = collection.url %}

        {% assign featured_image = false %}
        {% assign featured_image_alt = '' %}

        {% if block.settings.image %}
          {% assign featured_image = block.settings.image %}
          {% assign featured_image_alt = block.settings.image.alt | escape %}
        {% endif %}

        {%
          render 'collection-list-item',
          block: block,
          collection: collection,
          collection_image: featured_image,
          collection_image_alt: featured_image_alt
        %}
      {% endfor %}
    </ul>
  {% endif %}
</section>

{% schema %}
{
  "name": "Collection list",
  "class": "collection-list--section",
  "max_blocks": 20,
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Heading",
      "default": "Collection list"
    }
  ],
  "blocks": [
    {
      "type": "collection",
      "name": "Collection",
      "settings": [
        {
          "id": "collection",
          "type": "collection",
          "label": "Collection"
        },
        {
          "id": "image",
          "type": "image_picker",
          "label": "Image"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Collection list",
      "category": "Collection",
      "blocks": [
        {
          "type": "collection"
        },
        {
          "type": "collection"
        },
        {
          "type": "collection"
        },
        {
          "type": "collection"
        }
      ]
    }
  ]
}

{% endschema %}

 

 

Accepted Solution (1)
LitCommerce
Astronaut
2860 684 754

This is an accepted solution.

Hi @sukalde,

First, you need to add a class to distinguish the section here:

Screenshot.png

Code:

<section class="collection-list--container dynamic-collection-list-smeg2">

After that, change the CSS code I instructed before to the following code:

@media screen and (min-width: 860px) {
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner {
		display: flex;
	}
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner .collection--item {
		margin-top: 0 !important;
	}
}
@media screen and (max-width: 859px) {
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner {
		flex-wrap: wrap;
	}
}

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!

View solution in original post

Replies 11 (11)

Denishamakwana
Shopify Partner
1408 173 232

Welcome to shopify community.

Please share your store URL and if your store is password protected then please provide password too.

Thank you.

If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact me on denishabhensdadiya@gmail.com | Shopify Design Changes | Custom Modifications In to Shopify Theme

LitCommerce
Astronaut
2860 684 754

Hi @sukalde,

Please send your site and if your site is password protected, please send me the password. I will check it.

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!
sukalde
Excursionist
18 0 1

Thanks for the quick reply! 🙂

This is the collection I am working on

https://www.sukaldeusa.com/collections/smeg

@LitCommerce  @Denishamakwana 

 

LitCommerce
Astronaut
2860 684 754

Hi @sukalde,

Go to Assets > theme.css and paste this at the bottom of the file:

@media screen and (min-width: 860px) {
	.home-section--content.collection-list--inner {
		display: flex;
	}
	.home-section--content.collection-list--inner .collection--item {
		margin-top: 0 !important;
	}
}
@media screen and (max-width: 859px) {
	.home-section--content.collection-list--inner {
		flex-wrap: wrap;
	}
}

Hope it helps!

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!
sukalde
Excursionist
18 0 1

Yay!

Its working, one last question, can I somehow limit that code to only the following section:

{% section 'dynamic-collection-list-smeg2' %}

 

Right now my others sections are also changed

sukalde_0-1653504576451.png

 

And I am only looking to edit the following section:

 

{% section 'dynamic-collection-list-smeg2' %}

sukalde_1-1653504672914.png

 

 

 

LitCommerce
Astronaut
2860 684 754

This is an accepted solution.

Hi @sukalde,

First, you need to add a class to distinguish the section here:

Screenshot.png

Code:

<section class="collection-list--container dynamic-collection-list-smeg2">

After that, change the CSS code I instructed before to the following code:

@media screen and (min-width: 860px) {
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner {
		display: flex;
	}
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner .collection--item {
		margin-top: 0 !important;
	}
}
@media screen and (max-width: 859px) {
	.dynamic-collection-list-smeg2 .home-section--content.collection-list--inner {
		flex-wrap: wrap;
	}
}

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!
sukalde
Excursionist
18 0 1

Thank u so much for the quick reply, it worked! 😄

hannan_mujtaba
New Member
4 0 0

could you please help me i also want to do the same with my theme collection list I'm currently using ware house theme

disappearhere
Tourist
8 0 2

@LitCommerce can you help me do this exact same thing with Spotlight theme? Happy to donate!

 

My site is www.disappearhere.org

bittybee
New Member
15 0 0

@LitCommerce I need the something similar on my Collection List page, the images are too big and I cannot figure out how to make them smaller. I am using Symmetry theme.

hannan_mujtaba
New Member
4 0 0

i also want to do the same with my collection list I'm using warehouse theme