Divide Up Color Swatches

Kimball
Tourist
44 0 3

Hi again all. 

I appreciate the help on this forum - everyone is great. 

I have another design question regarding color swatches.  

I'm wondering if there is a way to divide them up like they are different options.  For instance, I have 70 different fabrics to choose from and some of them are cottons, some of them are linens, and some are velvets.  

I can't actually make them into different options because in that case you would have to choose one of each - which is not what we want.  

I'm wondering if there is a way to divide up all the different variants into groups and to label them so it changes from looking like this:

 

To something like this:

THANKS!

0 Likes
Kimball
Tourist
44 0 3

bump

0 Likes
jholl
Shopify Expert
351 0 39

I think you can do it two ways -- one way to create and manage lists in shopify is linklists, but you don't have to use them only for menus -- they can be a gui way to manage structured objects and array.  your code and loop through them all and in the future without having to adjust a list w/in the code.

the other way is to create a list, split it, and then cycle through or check it.  For example:

{% assign belgian1 = 'Red,Blue,Green' | split: ',' %}

will give you an array (though you won't see it):

[Red,Green,Blue]

and you can then check if the swatch you're on is in that list -- if so, include it, if not, skip it.

{% if belgian1 contains tag %}

And do that process for each section you want.

0 Likes
Kimball
Tourist
44 0 3

Interesting.  I know what you are talking about it but I'm not sure how to implement it. 

I'll look into it - thanks.

0 Likes
Kimball
Tourist
44 0 3

Cheers, I got it to work.  

Thanks for the thought jholl.  

Here's a photo of what it looks like now - much better.  

I can let others know how I managed to do it if you are interested.  

0 Likes
jeanette2
New Member
1 0 0

Hi! I'm very interested! Can you show me how  do you make?

0 Likes