Expanse theme - removing (16/16) collections limit in a Collection List

Gladiatorjonas
Excursionist
14 0 4

I have recently bought the Expanse theme for my workplace and have now run into an issue. It's very clever that you can output various collections on a given page directly via the customizer - but there is a limit of how many collections you can output- 16. I would love to remove this cap to post unlimited collections - or say 50 might be enough - but can't find the snippet to do so. Can anyone help? We are a publishing house, and I would like to use collections to display our writers alphabetically. 

Regards - and good karma to you if you solve the puzzle. I have an idea of where the code might be, but too unexperienced to just go ahead and play with the code.

expanse collection limit 16.JPG

Replies 10 (10)

dmwwebartisan
Shopify Partner
12280 2546 3694

@Gladiatorjonas 

Please share your theme.zip file i will check and send solution tomorrow.

Thanks!

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app
John_Biggs
Tourist
8 0 4

We are having the same issue. Why would they limit the amount of collections? And 16! That's nothing It's bad enough they do away with our previous navigations on pages. 

Gladiatorjonas
Excursionist
14 0 4

Hello dmwwebartisan. Thank you for your reply. I don't mean to be disrespectful, but Im sure sharing the theme could get me in trouble? 

dmwwebartisan
Shopify Partner
12280 2546 3694

@Gladiatorjonas 

I don't think so. You can share a link from where I can download your theme OR feel free to send the link in the message. Feel free to send message.

 

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app
dmwwebartisan
Shopify Partner
12280 2546 3694

@Gladiatorjonas 

There’s a limit of 16 blocks per section. You can specify a lower limit with the max_blocks attribute:

please check link for ref:

 https://shopify.dev/themes/architecture/sections/section-schema#max_blocks

Thnaks!

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app
Gladiatorjonas
Excursionist
14 0 4

Hello @dmwwebartisan - a lot of thanks for your time. Appreciated!

So when the limit is 16 - nothing can be done to change that - except specify a lower limit? That's the opposite of the result I was hoping for.

In our current theme I get the desired output via. linklists in a modded template - see code below.

<h3 id="abc">abc</h3><div class="grid-uniform">
  {% for link in linklists.forfatterabc.links %}
{% assign collection = link.object %}
    {% unless collection.handle == 'frontpage' %}
      {% assign collection_item_width = 'medium-down--one-half large--one-sixth wide--one-quarter' %}
      {% assign featured = collection.handle %}
      <div class="grid__item {{collection_item_width}} text-center">
        {% include 'collection-grid-item' %}
      </div>
    {% endunless %}
  {% endfor %}
</div>

I'm struggeling to understand how this can be done with the Expanse theme - preferably in the "Custom Content" Section where you can insert Liquid and HTML directly in the customize sink.

I've had a bit of luck (by googling and finding code I don't really understand yet)- it's just too advanced for me, but if I could get this to work, I would be set .... until the next issue arises.

{% for link in linklists.forfatterabc.links %}
<div class="grid-item>
<div class="new-grid product grid"><img src="{{ link.object.image.src | collection_img_url: 'medium' }}" alt="{{ link.object.title | escape  }}" /></a>
  
<a class="collection-item" href="{{ link.url }}">{{ link.title }}</a></div>

{% endfor %}
</div>

 

John_Biggs
Tourist
8 0 4

Every section I have explored so far has a 16 block limit. There must be some kind of fundamental issue with how Shopify designed 2.0.  So I'm doubtful this can be easily overcome. The simplest answer IMO is to copy the section code into a new one and then adjust the spacing so it appears as one unit. Although this will create some headaches on the back end maintenance. At this point that's all I got and how we are going to proceed. I'm truly amazed at this issue and wish SHOPIFY would address this. At least acknowledge it and let us know if it will be changed in the future. Not a very good experience "upgrading" to 2.0 and having less functionality!

Gladiatorjonas
Excursionist
14 0 4

So for everyone dealing with this issue. I found a workaround. What you can do is to put the desired collections into a menu and calling that menu via. liquid through the "Custom content" HTML section - also pulling the image from every collection. This will display exactly like the previous mentioned blocks and you can output whatever you have in the menu - no 16 items limit. Hope it makes sense. Just replace "yourlink" with your desired menu.

@John_Biggs this might interest you.

The code for doing this is: 

<h3 id="abc">abc</h3><div class="new-grid" data-view="6-3">
{% for link in linklists.yourlink.links %}
<div class="grid-item">
  <a class="collection-item" href="{{ link.url }}"><div class="collection-image-wrap collection-image--portrait">

<div class="collection-image collection-image--is-collection image-wrap">

<img class="lazyautosizes lazyloaded" src="{{ link.object.image.src | collection_img_url: 'medium' }}" alt="{{ link.object.title | escape  }}">

          <noscript>
            <img class="lazyloaded"
              src="{{ link.object.image.src | collection_img_url: 'medium' }}" alt="{{ link.object.title | escape  }}"
             >
          </noscript>
     </div></div>

    <span class="collection-item__title">{{ link.object.title | escape  }}</span>
  </a>
</div>
{% endfor %}
</div>

 

PaulNewton
Shopify Partner
6274 573 1319

@Gladiatorjonas wrote:

So for everyone dealing with this issue. I found a workaround. What you can do is to put the desired collections into a menu and calling that menu via. liquid through the "Custom content" HTML section - also pulling the image from every collection. This will display exactly like the previous mentioned blocks and you can output whatever you have in the menu - no 16 items limit. Hope it makes sense. Just replace "yourlink" with your desired menu.


Good work, You can mark your own solution as the solution so future users see a nice fat checkmark in the search

N.B. You can also access collections directly https://shopify.dev/api/liquid/objects/#collections i.e. collections.frontpage.products

Advanced use accessor [] syntax to use strings to get the needed collection , psuedocode:

 

{%- assign collection_handles = "collection-handle-1,collection-handle-2,collection-handle-3" | split:"," -%}
{%- for collection_handle in collection_handles -%}
 {%- comment -%} "this_collection" instead of "collection" or "current_collection" to avoid oddities{%- endcomment -%}
 {% assign this_collection = collections[collection_handle].products %}
  {{- this_collection.title -}} 
{%- endfor -%}

 

For deeper integration there is a setting type to let you select a linklist|menu in the theme settings themself https://shopify.dev/themes/architecture/settings/input-settings#link_list useful if you need to consistently setup sections for this feature instead of having to manually hard code a new menu name each time..

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


PaulNewton
Shopify Partner
6274 573 1319

@John_Biggs wrote:

Every section I have explored so far has a 16 block limit. There must be some kind of fundamental issue 


Nope, this is fundamental purposefuly sane LIMIT not an issue, there a over a million shopify stores and this is a new feature requiring reasonability before going infinite.


The simplest answer IMO is to copy the section code into a new one and then adjust the spacing so it appears as one unit. Although this will create some headaches on the back end maintenance. At this point that's all I got and how we are going to proceed. I'm truly amazed at this issue and wish SHOPIFY would address this. At least acknowledge it and let us know if it will be changed in the future. Not a very good experience "upgrading" to 2.0 and having less functionality!

Yup spot on for a quick tactical fix. Not sure though why you'd interpret sections everywhere JSON templates as being less functional than the prior restriction of only having dynamic orderable sections on the frontpage.

The strategy meanwhile is thought through design , if you need more blocks than reasonable limits allow that's a red flag you need to customize your theme to support your business logic naturally so you get convention instead of endless theme setting configuration.

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org