Skip Navigation

[Waiting for user confirmation] Toolset Slideshow Block vs. View using repeatable fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by Minesh 3 days, 4 hours ago.

Assisted by: Minesh.

Author
Posts
#2821247

Tell us what you are trying to do? I'm trying to display a slideshow that autoplays using uploaded images.

Is there any documentation that you are following? Types, Views, Toolset
Is there a similar example that we can see? N/A
What is the link to your site? hidden link

I have created a custom field that allows the user to upload multiple images to a page - to be displayed in a slideshow.
I'd like the slideshow to autoplay and loop to cycle through the images with no front-end controls.

Unfortunately, the Toolset Image Slider block does not allow this. I'd consider this a bug... play/stop/cycling images is extremely BASIC functionality for an image slider, and should definitely be included in the slider block.

I know I can create a View-based slider which includes the autoplay functionality (via the pagination settings), but I'm not sure how to get this to work using the images from the repeatable field. I don't think this is possible - the view does not allow me to select the repeatable field for the source images, and the gallery block (with a dynamic source) does not include pagination controls.

Is the only way to do this is to create an additional CPT (for example slides) and then have the user upload them individually in a separate place?

I was hoping I could do this EASILY from the page the user is working on.

Thanks for any help.

#2821578

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You are rigth, there is no cycle feature available for now with the image slider block.

I suggest in such case you should try to add flexslider and build your slider using flexslider.
- hidden link

If you are using Toolset Blocks plugin, you can enable the legacy views feature by following the steps given with the followig link:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

Once you enable the legacy view, you can create a view in legacy mode. You can create Carousel slider using flexslider where you can use the repeating image. Here is a doc where steps are mentioned.
=> hidden link

#2821846

I can't access the google doc. Can you please provide a different way to access the document? PDF? Image?
Thanks.

#2821865

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To enable the legacy view:
- https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

Create a slider from repeating image custom fields

Views lets you create sliders that transition between posts, but what if you want to create a slider that rotates the images added as custom fields to an individual post?

The key is to generate markup consistent with what is expected by your chosen slider library, and the principles are the same for most sliders. Here we use the FlexSlider 2 library from WooThemes.

Our solution needs to generate markup that matches the following format:

<div class="flexslider">
  <ul class="slides">
    <li>
      <img src="slide1.jpg" />
    </li>
    <li>
      <img src="slide2.jpg" />
    </li>
  </ul>
</div>

Steps you need to follow:

1. Enqueue the slider library JS and CSS files
Add the following to your theme's functions.php file (or using a plugin such as Code Snippets)

function ts_enqueue_flexslider(){
    if ( !is_admin() ) {
        wp_enqueue_script( 'flexslider-js', '<em><u>hidden link</u></em>', array( 'jquery' ), '1.0' );
        wp_enqueue_style( 'flexslider-css', '<em><u>hidden link</u></em>', array(), '1.0' );
    }
}
add_action( 'wp_enqueue_scripts', 'ts_enqueue_flexslider' );

2. Generate the required markup in your template
Add the following to your Content Template (or to a Visual Editor cell in a Template Layout), editing the name of the image custom field as required (wpcf-slides & slides)

<div class="flexslider">
    <ul class="slides">
        [wpv-for-each field="wpcf-slides"]
        <li>
            [types field='slides' alt='%%ALT%%' title='%%TITLE%%' size='large' align='none' resize='proportional' separator=', '][/types]
        </li>
        [/wpv-for-each]
    </ul>
</div>

3. Initialise the slider
Add the following JS to the custom JS section of your Content Template or view:

( function( $ ) {
    $( document ).ready( function(){
      $('.flexslider').flexslider({
        animation: "slide"
      }); 
    });
})( jQuery );

Notes
We enqueue the flexslider library on all front-end pages. You may want to add checks to only enqueue it for specific pages or templates.

The flexslider library includes many options that you can set in the third step, see the flexslider documentation for details.