Back to CodeFleet.net

Template Variables

This is the full list of PHP variables that can be accessed within templates. For a working example open up cyclone-slider-2/templates/standard/slider.php.

Name Type Description Example Value
$custom_count integer Total count of custom slides in the slideshow. 0
$image_count integer Total count of image slides in the slideshow. 6
$slider_count integer Total count slideshows in the current page. 2
$slider_html_id string Unique identifier for slideshow. cycloneslider-test-2
$slider_settings array Contain slideshow properties. See below
$slides array Contain slides and their properties. See below
$vimeo_count integer Total count of Vimeo slides in the slideshow. 0
$youtube_count integer Total count of YouTube slides in the slideshow. 0

Variable $slider_settings keys

Below are the keys of variable $slider_settings. It denotes the following usage: $slider_settings['allow_wrap']

Name Type Description Example
allow_wrap boolean Tells if slideshow wraps to beginning slide when it reaches the end slide. true
auto_height string Width and height as ratio. 500:300
auto_height_easing string Easing animation for auto height. null
auto_height_speed integer Speed of auto height animation in milliseconds. 250
delay integer Milliseconds delay before first slide begins auto playing. 0
dynamic_height string Tells slideshow to adjust its height depending on current slide. Can be either "on" or "off". off
easing string The easing type to use for slideshow transition. Default is blank.
fx string The transition effect to use. fade
height integer The slideshow height. 300
hide_non_active boolean Determines if non active slides are hidden in css (display:none). False, will not hide the non active slide. true
hover_pause boolean Determines if slideshow will pause on mouse hover. true
random boolean Tells if order of slides are randomized on every page visit. Note: Slides are randomized in PHP not in JS. false
resize integer 1 means resize images to slideshow dimensions, 0 to use the original uploaded image. 1
resize_option string
  • auto - Cyclone Slider decides the resize option.
  • crop - Resize and remove excess parts.
  • exact - Resize to exact dimensions.
  • landscape - Resize to exact width.
  • portrait - Resize to exact height.
auto
show_nav integer To show the pagers or not. 1
show_prev_next integer Whether to show previous and next buttons. 1
speed integer Speed of transition in milliseconds. 1000
swipe boolean Swipe gesture support for touch devices. false
template string Template being used. thumbnails
tile_count integer The number of tiles to use in the transition. 7
tile_delay integer Delay of tile transition in milliseconds. 100
tile_vertical boolean Tiles are vertical or horizontal. true
timeout integer The time between slide transitions in milliseconds. 4000
width integer Slideshow width in pixels. 500
width_management string
  • responsive - resizes to smaller size but maximum width will be equal to the provided width.
  • full - the same as responsive but maximum width will be equal to its container ignoring the provided width.
  • fixed - width and height are not resized.
full

Variable $slides

$slides is an array of slide properties so you need to loop thru each one to access one slide:

<?php
foreach($slides as $i=>$slide):
    echo $slide['id'];
    echo $slide['type'];
    echo $slide['link']; //So on and so forth
endforeach;

Below are the keys of variable $slide. It denotes the following usage: $slide['custom']

Name Type Description Example
custom string The content of the custom slide. Allows HTML. <p>Lo and behold thy HTML!</p>
description string The caption description. Allows HTML. Caption here..
enable_slide_effects integer Tells if slide effect is enabled. Overrides the slideshow setting. 0
full_image_url string The URL of the original slide image. http://localhost/wp/plugins/cyclone-slider-2/wp-content/uploads/2015/01/sunset.jpg
fx string Transition effect for this slide. Overrides the slideshow setting. default
hidden integer 0 for hidden slide, 1 to show. 0
id integer The WordPress attachment ID of the slide image. 11
image_thumbnails array An array of thumbnails depending on the template. See Thumbnails template for example.
image_url string The URL of the resized slide image based on the slideshow settings. http://localhost/wp/plugins/cyclone-slider-2/wp-content/uploads/2015/01/sunset-500x300.jpg
img_alt string Alternate text for slide image tag. <img alt="Alt text goes here">.
img_title string Title for the slide image tag. <img title="Title text goes here">.
link string The hyperlink of the slide. http://www.codefleet.net/
link_target string
  • _self - Open link in the same browser window
  • _blank - Open link in new browser tab or window
  • lightbox - Open link in lightbox (Pro only)
_self
slide_data_attributes string The cycle2 per slide settings as HTML data attributes.
speed integer Slide transition speed. Overrides the slideshow setting.
testimonial string The testimonial slide type content. Allows HTML. This slideshow is awesome! Solid 5 star rating.
testimonial_author string The author name for testimonial slide.
testimonial_link string The URL to the testimonial.
testimonial_link_target string
  • _self - Open link in the same browser window
  • _blank - Open link in new browser tab or window
  • lightbox - Open link in lightbox (Pro only)
_self
tile_count integer The number of tiles to use in the transition. Overrides the slideshow setting. 7
tile_delay integer Milliseconds of tile delay effect. Overrides the slideshow setting. 100
tile_vertical boolean Tiles are vertical or horizontal. Overrides the slideshow setting. true
timeout integer Slide delay. Overrides the slideshow setting.
title string The slide caption title.
type string The slide type. Can be: image, youtube, vimeo, custom, testimonial. image
vimeo_url string URL to Vimeo video.
youtube_related boolean If true the YouTube video will not show suggested videos when it finishes. false
youtube_url string URL of YouTube video.