diff --git a/sections/slideshow.liquid b/sections/slideshow.liquid index 206c43dde20..3286361b1f4 100644 --- a/sections/slideshow.liquid +++ b/sections/slideshow.liquid @@ -32,61 +32,7 @@ aria-label="{{ section.settings.accessibility_info | escape }}" > {%- if section.settings.auto_rotate and section.blocks.size > 1 -%} -
- -
- {%- if section.settings.slider_visual == 'counter' -%} - 1 - - {{ 'general.slider.of' | t }} - {{ section.blocks.size }} - {%- else -%} -
- {%- for block in section.blocks -%} - - {%- endfor -%} -
- {%- endif -%} -
- - - {%- if section.settings.auto_rotate -%} - - {%- endif -%} -
+ {% render 'slideshow-controls', additional_class: 'slideshow__controls--top' %} {%- endif -%}
{%- if section.blocks.size > 1 and section.settings.auto_rotate == false -%} -
- -
- {%- if section.settings.slider_visual == 'counter' -%} - 1 - - {{ 'general.slider.of' | t }} - {{ section.blocks.size }} - {%- else -%} -
- {%- for block in section.blocks -%} - - {%- endfor -%} -
- {%- endif -%} -
- - - {%- if section.settings.auto_rotate -%} - - {%- endif -%} -
+ {% render 'slideshow-controls' %} {%- endif -%} diff --git a/snippets/slideshow-controls.liquid b/snippets/slideshow-controls.liquid new file mode 100644 index 00000000000..b4b7db4ae13 --- /dev/null +++ b/snippets/slideshow-controls.liquid @@ -0,0 +1,66 @@ +{% comment %} + Renders controls for a slideshow. + + Accepts: + - additional_class: {String} (optional) additional class to attach to the controls element + + Usage: + {% render 'slideshow-controls', additional_class: 'additional__class-example' %} + +{% endcomment %} + +
+ +
+ {%- if section.settings.slider_visual == 'counter' -%} + 1 + + {{ 'general.slider.of' | t }} + {{ section.blocks.size }} + {%- else -%} +
+ {%- for block in section.blocks -%} + + {%- endfor -%} +
+ {%- endif -%} +
+ + + {%- if section.settings.auto_rotate -%} + + {%- endif -%} +