Using print\_media\_templates i add some settings into wordpress gallery creator that allow me to chose gallery shortcode output (default gallery, masonry, slider) based on additional shortcode parameters.

My code so far :

```
<?php

add_action('print_media_templates', function(){ ?>

<script type="text/html" id="tmpl-custom-gallery-setting">

    <label class="setting">
        <span>Gallery Type</span>
        <select name="type" data-setting="type" onchange="getval(this);">
            <option value="default">Default</option>
            <option value="masonry">Masonry</option>
            <option value="slider">Slider</option>
        </select>
    </label>

<div id="slider-settings">
    <label class="setting">
        <span>Animation</span>
        <select id="gallery-type" name="animation" data-settings="animation">
            <option value=""></option>
            <option value="fade">Fade</option>
            <option value="slide">Slide</option>
        </select>
    </label>
</div>

</script>

<script>

    jQuery(document).ready(function() {

        wp.media.view.Settings.Gallery = wp.media.view.Settings.Gallery.extend({
        template: function(view){
          return wp.media.template('gallery-settings')(view)
               + wp.media.template('custom-gallery-setting')(view);
        }
        });
    });

</script>

<?php

});

?>

```

It's only small part as example since there's much more options to each gallery type. Since there's lot of options i want to display only one corresponding to selected gallery type. In this example i want to display #slider-settings only when #gallery-type select value == "slider".

As for checking select value i found this code:

```
<script>
    function getval(sel) {
        if (sel.value == "slider") {
          alert(sel.value);
        }
    }
</script>

```

with return selected type value (along with onchange="" on #gallery-type select) and display it if it's set to "slider". 

But when i want to hide #slider-settings like :

```
function getval(sel) {
    if (sel.value != "slider") {
        $('#slider-settings').hide();
    }
}

```

it's not hiding at all.