Closed (fixed)
Project:
Splide
Version:
1.0.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2022 at 18:41 UTC
Updated:
30 May 2023 at 05:29 UTC
Jump to comment: Most recent
Is there a way to prevent this from happening:

...without setting an explicit width on the nav slider? (Since there could be any number of slides in other sliders using the same optionset.) Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Shot 2022-08-04 at 11.37.50 AM.png | 1.5 MB | wrd-oaitsd |
Comments
Comment #2
gausarts commentedThere are a few hooks at splide.api.php, not sure which one will work, likely optionset_alter.
I haven't checked, but perhaps you will check for
countvariable, might be in blazies or splides, then override the optionset that decides the max amount of thumbnails to display if the amount is less than 3, etc. I forgot the exact name :)Comment #3
wrd-oaitsd commentedSo maybe:
Sound reasonable?
Comment #4
gausarts commentedPerhaps the entire related options are type, perPage, perMove, and clones.
Try changing type
loopto others for both main and its nav optionsets. Otherwise being out of sync.For now just focus on type, hopefully the system takes care of the rest. If not, modify other options just as well.
Let me know how you come up?
Comment #5
gausarts commentedPerhaps the quasi-code is like this:
If optionset name == blah and count < 4, then type = slide.
Repeat for the main optionset, but might need a dedicated one to not override those not having navigations. Please clone one to avoid headaches.
If generic, you may want to add more conditions based on entity ID, field name, etc. to not override the entire site config.
Comment #6
wrd-oaitsd commentedYou're right, switching it to Slide solves the problem I'm just checking for the optionset name and, if the number of slides is less than the perPage value, switching the type to Slide. Works great. There's a bit of a styling issue (the first thumbnail gets cut off when the active styles get applied), but that should be fixable in the theme. Thanks!
Comment #7
gausarts commentedFeel free to re-open if any patch to benefit others.
Thanks.
Comment #8
gausarts commented