Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

How to add new slides to slider from admin panel

  • #5000
    Avatar photo[anonymous]

    Hello friends and developers! I started to discover your great product – publii. I think it will have great future and I will be glad to use this product. I am new one here. I tried to find the answer in developers doc and on forum but didn’t find, so I am asking for help!

    How to add new slides to slider from admin panel? I want to add a code with slider. It will work, I know it. Then I want to give the admin of
    the site the possibility to add photos in this slider without direct code adding, just from admin panel from special field.

    Will be glad to recieve your answers and advices!

    You are doing great work!

    #5010
    Avatar photo[anonymous]

    Hi,

    At this moment one of the easiest ways to create slider is create set of hidden posts and use them as a source for generating slides in the website (you use then featured posts as a slide image). You can also mark them by one tag and the use getPostsByTags to find these posts.

    Alternatively you can use image options to specify slider images as a theme options. But then you have to specify options for all slides even if they will be unused (e.g. you must prepare options for 8 slides, when 3 will be used usually).

    #5011
    Avatar photo[anonymous]

    If I remember the first variant has been used in the Portfolio theme: https://marketplace.getpublii.com/themes/portfolio/

    #5016
    Avatar photo[anonymous]
    Tomasz Dziuda wrote:

    Hi,

    At this moment one of the easiest ways to create slider is create set of hidden posts and use them as a source for generating slides in the website (you use then featured posts as a slide image). You can also mark them by one tag and the use getPostsByTags to find these posts.

    Alternatively you can use image options to specify slider images as a theme options. But then you have to specify options for all slides even if they will be unused (e.g. you must prepare options for 8 slides, when 3 will be used usually).

    I understood you good,  Tomasz! Thank you for such fast answer and thank you for help. I was thinking on the second variant with theme options but you finished my idea and I will try this way. I will aslo check the first idea and will look how it is working in Portfolio theme from the code side. Once again, thank you so much!

    #11511
    Avatar photo[anonymous]

    Tomasz,

    Is there any documentation on how to add the slider the way you are describing above?