• Resolved apaulfx

    (@apaulfx)


    I want to have two different slideshows on my homepage, i added this to customize the first one. However i want to add a custom set of options for the second slideshow instead of using the same options from the first slide show.
    Is there a way to define an additional set of custom fields different from the first using the slideshow id?

    Example :
    Top Slideshow
    ————–
    title
    image
    more link
    featured link
    description

    Bottom Slideshow ( this is the one that keeps showing the above values)
    ————–
    title
    subtitle
    description

    add_filter( 'image_slider_fields', 'new_slider_fields' );
    
    function new_slider_fields()
    {
      $array = array(
        array(
          'name'  => 'image',
          'type'  => 'text',
          'label' => 'Slide Image URL',
          'class' => ''
        ),
        array(
          'name'  => 'more',
          'type'  => 'text',
          'label' => 'More Info Link',
          'class' => ''
        ),
        array(
          'name'  => 'featured',
          'type'  => 'text',
          'label' => 'Featured Demo Link',
          'class' => ''
        ),
        array(
          'name'  => 'description',
          'type'  => 'textarea',
          'label' => 'Slide Description',
          'class' => ''
        )
      );
      return $array;
    }

    [No bumping, please.]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am currently looking to do the same thing, this is all the more reasons why we need a generic “Custom List” which can be customized individually for a certain number of fields.

    Plugin Author Derek Herman

    (@valendesigns)

    In version 1.1.8 which is coming very very soon, you can change fields on a per slider basis.

    Hi,

    I am sorry to dig out this old post but I currently use 1.1.8.1 (and loving it) but still see no possibility to use two different slider sets. Meaning two completely different sets of input fields.

    If you implement this what do I have to do to use it?

    Thanks for this awesome plugin!

    Regards, DD

    Plugin Author Derek Herman

    (@valendesigns)

    The ‘image_slider_fields’ filter has an ID variable that you need to test against if you want to select a certain slider. Otherwise, you’re changing all the sliders at once.

    add_filter( 'image_slider_fields', 'new_slider_fields', 10, 2 );
    
    function new_slider_fields( $array, $id ) {
      if ( 'my_slider' == $id ) {
        $array = array(
          array(
            'name'  => 'image',
            'type'  => 'text',
            'label' => 'Slide Image URL',
            'class' => ''
          ),
          array(
            'name'  => 'more',
            'type'  => 'text',
            'label' => 'More Info Link',
            'class' => ''
          ),
          array(
            'name'  => 'featured',
            'type'  => 'text',
            'label' => 'Featured Demo Link',
            'class' => ''
          ),
          array(
            'name'  => 'description',
            'type'  => 'textarea',
            'label' => 'Slide Description',
            'class' => ''
          )
        );
      }
    
      return $array;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: OptionTree] 2 Different Custom Slider Templates?’ is closed to new replies.