Can you make a shopify section setting mandatory?

Solved
Astronaut
1011 131 240

Hey everyone. I'm currently making a shopify section that is a slideshow that will swap out desktop and mobile images. However, I'd like it to be possible to include more than one on a page if the user wanted to. This conflicts with the slickslider that I use as you can't have more than one slider with the same name. I avoid this problem by having the user set the slider name in the customize editor. However, if they don't set a name this will break. Is there a way to make a section setting mandatory? Or does anyone have any other idea on how to circumvent this issue? Thanks for your time.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted

Success.

Shopify Expert
9778 86 1526

You can make this mandatory in the sense that if the user doesn't add a value into the field you just choose not to show the section at all. In the theme settings however that info will remain optional.

 

As long as you have a way to identify each slideshow it really shouldn't matter if there's a name or not. For example, if there's the same class or data attribute on both you will still be able to reference each individually with JS via their index.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Astronaut
1011 131 240
Good point, I didnt think about looping over them to initialize slick. Thanks a lot : D
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes