How to get lightslider to work

Could someone help me with lightslider plugin
i tried making a simple text slide by putting lightslider.md in a page directory.
the contents look like this
first slide

second slide

third

but it just show as one without a slide

could someone help me

Hi @yehuda , Welcome to Grav :slight_smile:

I have had a bit of a play and finally got it working , the plugin instructions were a little vague , but to get it working as it was intended in a module page is as follows

install grav , ensure the error, problems and lightslider plugin are installed and enabled.

Download the github resource which will give you a new folder 03.LightSlider and copy it your pages directory.

Expand the archive and copy the 03.Lightslider to your pages directory

It shows the layout format to get it working as a module.

Basically a modular page is created and then under that is modular
pages / items including the slider is made as a module underneath.

I have added a bit of text above and below it as the modular directory and used page number rather than _prefixes, so you can change the order through the admin panel.

If you made the modular subpage as non-number prefix you will have to alter the 03.LightSlider page and add your custom order in the frontmatter like

   order:
        by: default
        dir: asc
        custom:
            - _above
            - _slider
            - _below

and finally the extra line in the 03.LightSlider modular.md
will make sure it show the main site navigation

onpage_menu: false

The demo has been tested with Quark theme, and the above onpage_menu is currently only applicable to that theme (eeK) Ask away if you have any more questions

1 Like

@yehuda, Judging from the way the resulting page looks, it seems you want a regular page containing a slider.

There are two ways to get it done. I’ll describe the easy one here:

  • The folder structure should look as follows:

     pages
    ├── 01.home
    ├── 02.page-with-slider
    │   └── default.md
    └── slider-content
        └── lightslider.md
    
  • Page ‘02.page-with-slider/default.md’ contains the following:

    ---
    title: Slider
    process:
      twig: true
    ---
    
    {% include 'modular/lightslider.html.twig' with 
      {'page': page.find('/slider-content')} %}
    

    You are free to add any text above and below the {% ... %} snippet.

  • And page ‘/slider-content/lightslider.md’ contains the following:

    ---
    title: Slider Content
    routable: false
    visible: false
    lightslider:
      slider_type: text
      ...your-slider-settings
    ---
    
    # Shop Geek Stuff
    ## We have all your **geek** needs covered..
    ---
    # SnipCart Powered
    ## **Grav** plus **SnipCart** equals easy shopping
    ---
    # A Huge Variety
    ## A great selection of **bits** and **bobs**
    

The other option is to include the Twig snippet {% ... %} inside a template. And assign the name of the template to the filename of the page. But for this, you will need to override the theme.

Hope this helps…

2 Likes