# KirbyText Image Slider

**URL:** <https://forum.getkirby.com/t/kirbytext-image-slider/5614>\
**Category:** Solutions\
**Tags:** v2\
**Created:** [October 27, 2016, 2:06pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614 "2016-10-27T14:06:46Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![nate](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nate/32/83_2.png) [@nate](https://forum.getkirby.com/u/nate)\
**Post date:** [October 27, 2016, 2:06pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/1 "2016-10-27T14:06:46Z")

</div>

Here’s a way to generate an image slider with a very simple KirbyText tag. All the files and documentation on how to install and use it are in this gist:

[https://gist.github.com/nsteiner/0f132394448967d6785bb0948350c8b5](https://gist.github.com/nsteiner/0f132394448967d6785bb0948350c8b5)

---

<div class="post-metadata">

**Author:** ![simon2017](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simon2017/32/7442_2.png) [@simon2017](https://forum.getkirby.com/u/simon2017)\
**Post date:** [October 27, 2016, 2:42pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/2 "2016-10-27T14:42:29Z")

</div>

Thanks a lot!, thats very helpfull for me 😊

---

<div class="post-metadata">

**Author:** ![jliekim](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jliekim](https://forum.getkirby.com/u/jliekim)\
**Post date:** [April 3, 2017, 11:43pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/3 "2017-04-03T23:43:39Z")

</div>

Hi Nate,

Many thanks for this simple image slider solution!

I am a noob so having a hard time with the last step: “initiate the lory script”. Does the following code look correct to you? I have it inserted in my html head element.

```
   <?php echo js('assets/js/jquery.lory.min.js') ?>
    	<script>
        $(function(){

            $('.js_slider').lory({
             infinite: 1
            });
      
        });
        </script>
```

---

<div class="post-metadata">

**Author:** ![nate](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nate/32/83_2.png) [@nate](https://forum.getkirby.com/u/nate)\
**Post date:** [April 4, 2017, 1:33am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/4 "2017-04-04T01:33:15Z")

</div>

Hi @jliekim what you have looks correct, so I think the only thing that might be missing is that you need to also have jQuery for this plugin. Are you calling it in before this code?

```auto
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

```

If that doesn’t help, message me directly and I’ll see if I can help. Good luck!

---

<div class="post-metadata">

**Author:** ![mhe](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mhe](https://forum.getkirby.com/u/mhe)\
**Post date:** [July 10, 2017, 7:53am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/5 "2017-07-10T07:53:13Z")

</div>

Hi Nate,  
i’m also a noob and need help with the Kirbytext Image slider.

I put slider.php into the folder “tags”, included the jquery.lory.min.js, the sliderstart and also jquery. But i have two questions: Where schould i put the name of the images? and how to include the slider into a site?

Sorry for that noob questions;)

Greetings  
manu

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 10, 2017, 8:15am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/6 "2017-07-10T08:15:33Z")

</div>

It is a [custom kirbytag](https://getkirby.com/docs/developer-guide/kirbytext/tags), so you put the kirbytag somewhere in a textarea field. The images are grabbed by some common filename part, for example, if all images contain the part “slider”, you can put the tag `(slider: slider)` into you textarea field. Check out the examples in the readme of the plugin.

---

<div class="post-metadata">

**Author:** ![mhe](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mhe](https://forum.getkirby.com/u/mhe)\
**Post date:** [July 10, 2017, 8:35am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/7 "2017-07-10T08:35:13Z")

</div>

thank you for the fast answer!  
Sure, I’ve read the readme! But i have still the same question…  
so i have to put the “slider: image-” into the yml file?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 10, 2017, 8:40am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/8 "2017-07-10T08:40:39Z")

</div>

No, into a textarea field in the Panel.

 ![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/9/958d727d5ee41c87304c7ddc69338183f92cc81a.png)

And then in your template for that page, you have to render that field using the Kirbytext method:

```auto
<?php echo $page->text()->kirbytext() ?>

```

Provided the field you defined in your blueprint (i.e. the .yml file) is called `text`.

---

<div class="post-metadata">

**Author:** ![mhe](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mhe](https://forum.getkirby.com/u/mhe)\
**Post date:** [July 10, 2017, 8:49am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/9 "2017-07-10T08:49:09Z")

</div>

Thank you!  
i got it!

---

<div class="post-metadata">

**Author:** ![hardjul](https://avatars.discourse-cdn.com/v4/letter/h/db5fbb/32.png) [@hardjul](https://forum.getkirby.com/u/hardjul)\
**Post date:** [October 27, 2017, 9:18pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/10 "2017-10-27T21:18:55Z")

</div>

Hi There,

another noob question I am afraid. I copied

- slider.php to site/tags and
- jquery.lory.min.js to assets/js/jquery.lory.min.js

I am not sure where the code needs to go. I tried to copy the following lines into my footer snippet with no success.

```
<footer class="footer cf" role="contentinfo">
      </footer>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<script>
function myFunction() {
    var x = document.getElementById("myDIV");
    if (x.style.display === "none") {
        x.style.display = "block";
    } else {
        x.style.display = "none";
    }
}
</script>

<?php echo js('assets/js/jquery.lory.min.js') ?>
    	<script>
        $(function(){

            $('.js_slider').lory({
             infinite: 1
            });
      
        });
        </script>

</body>
</html>

```

I have tried to copy it directly into the relevant template which didn’t work for me either

```
 <?php snippet('header') ?>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

    <?php echo js('assets/js/jquery.lory.min.js') ?>
        	<script>
        $(function(){

            $('.js_slider').lory({
             infinite: 1
            });
      
        });
        </script> 

<main class="main" role="main">
    
    <article class="article single wrap">

      <header class="article-header">
        <h1><?= $page->title()->html() ?></h1>
      <div class="text">
          
        </div>
      
      </header>

    <div class="text">
        <?= $page->text()->kirbytext() ?>
<hr />
<?php snippet('prevnext', ['flip' => true]) ?>

      </div>
      
    </article>

  </main>

<?php snippet('footer') ?>

```

if anyone could help me with this noob-affair, I’d appreciate it a lot.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 28, 2017, 7:05am UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/11 "2017-10-28T07:05:26Z")

</div>

What exactly does not work as expected? When you inspect your source code, is there a list with images?

How do you add you list of images? Looks like the “whatever” option, for example, cannot work. The tag expects a name pattern each image starts with, so you cannot feed it a comma separated list of images, for example.

---

<div class="post-metadata">

**Author:** ![exeldoc](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/exeldoc/32/6224_2.png) [@exeldoc](https://forum.getkirby.com/u/exeldoc)\
**Post date:** [March 25, 2020, 4:09pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/12 "2020-03-25T16:09:31Z")

</div>

hey there.  
Does this Slider also work on #kirby-3 ?  
In my case it is not working – so I was wondering.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [March 25, 2020, 4:18pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/13 "2020-03-25T16:18:07Z")

</div>

The [syntax for registering custom KirbyTags](https://getkirby.com/docs/reference/plugins/extensions/kirbytags) and plugins in general has changed, so no, you would have to adapt the code.

---

<div class="post-metadata">

**Author:** ![exeldoc](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/exeldoc/32/6224_2.png) [@exeldoc](https://forum.getkirby.com/u/exeldoc)\
**Post date:** [March 25, 2020, 4:24pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/14 "2020-03-25T16:24:28Z")

</div>

Ah. I thought so.  
thanks.

Any recomandations for a slider solution on Kirby3? 😅  
i am looking vor a very simple slider.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [March 25, 2020, 4:31pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/15 "2020-03-25T16:31:53Z")

</div>

This has nothing to do with Kirby, such sliders work with any system. Here are some options:

- [https://github.com/ganlanyuan/tiny-slider](https://github.com/ganlanyuan/tiny-slider)
- [https://pawelgrzybek.github.io/siema](https://pawelgrzybek.github.io/siema)
- [http://kenwheeler.github.io/slick/](http://kenwheeler.github.io/slick/)
- [https://glidejs.com/](https://glidejs.com/)
- [https://swiperjs.com/api/#keyboard](https://swiperjs.com/api/#keyboard)
- [https://flickity.metafizzy.co/](https://flickity.metafizzy.co/)

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:23pm UTC](https://forum.getkirby.com/t/kirbytext-image-slider/5614/16 "2025-02-06T17:23:05Z")

</div>

Archived on February 6, 2025, 5:23pm UTC


