Skip to content

Latest commit

 

History

History
166 lines (134 loc) · 6.97 KB

slideshow.md

File metadata and controls

166 lines (134 loc) · 6.97 KB
layout title searchable versions
widget
Slideshow
true
version url
Version 2.0
/widgets/v2/slideshow/
version url
Version 1.0
/widgets/v1/slideshow/

Slideshow

Much in the same way the gallery widget works, the slideshow widget allows the user to display a selection or group of images that have been uploaded to the Images section of the Editor. By default the slideshow comes with no images, the user must select them when they select the widget. If you are using the slideshow as part of your template you can state the images that are shown.

Examples

Basic usage

{% highlight python %} {% raw %}

{{widget('responsiveslideshow', 'slideshow', {})|raw}}

{% endraw %} {% endhighlight %}

The above example will display an area in the template where the user can select and then add images to, it will not show any images by default.

Example usage

{% highlight python %} {% raw %}

{{widget('responsiveslideshow', 'slideshow', { 'duration':'3', 'transSpeed': '1000', 'transType': 'fade', 'showButtons': true, 'showBullets': false, 'allowPause': true, 'allowLoop': true, 'images':[ { 'imageHeight':'350', 'imageWidth':'300', 'url':'http://placehold.it/350x300', 'title':'First slide title', 'description': 'First slide description' }, { 'imageHeight':'350', 'imageWidth':'400', 'url':'http://placehold.it/350x400', 'title':'Second slide title', 'description': 'Second slide description' }, { 'imageHeight':'350', 'imageWidth':'500', 'url':'http://placehold.it/350x500', 'title':'Third slide title', 'description': 'Third slide description' } ] })|raw}}

{% endraw %} {% endhighlight %}

Resulting HTML:

{% highlight html %} {% raw %}

  • First slide title First slide title First slide description
  • Second slide title Second slide title Second slide description
  • Third slide title Third slide title Third slide description
Previous Pause Next

{% endraw %} {% endhighlight %}

Widget options

You can change the following options for the widget:

  • duration: The duration of time the slide is shown for in seconds.

  • transSpeed: The speed of the slide transition in milliseconds.

  • transType: The type of transition between slides. There are currently 3 possible options; dissolve, fade, and none.

  • showTitle: Whether to show or hide the title of each slide. true for show and false for hide.

  • showDescription: Whether to show or hide the description of each slide. true for show and false for hide.

  • showButtons: Whether to show or hide the previous and next controls. true for show and false for hide.

  • showBullets: Whether to show or hide the numbered pagination controls. true for show and false for hide.

  • allowPause: Whether to show or hide the pause button. true for show and false for hide.

  • allowLoop: Whether the slideshow should loop through the images repeatively. true to loop them, false to stop at the end of the cycle.

  • crop: Whether the images should crop or fit the slideshow area. Setting to true will make the images fill the entire slideshow space, false will make them fit the available space but keep them entirely visible.

  • images: The default images for the slideshow, see Setting images for more details.

Setting images

{% highlight python %} {% raw %} ... { 'imageHeight':'350', 'imageWidth':'300', 'url':'http://placehold.it/350x300', 'title':'First slide title', 'description': 'First slide description' } ... {% endraw %} {% endhighlight %}

To see the above example in context please refer to the Example usage. The images will be shown as default in the template, but they won't be shown in the images panel of the Editor. If the user replaces the images they will no longer be accessible, you will need to state them in the metadata file in order for them to appear in the images panel. The url can be either an internal or external image path, all other image settings are optional.