Add No Purchase Necessary Text to OLM Carousel Slider

How to add an additional field to the OLM carousel. 

Open custom.scss and add the following code:

    .carousel p.npn-text {
        position: absolute;
        bottom: 5px;
        right: 20px;
    }
    a.carousel-control {
        display: none;
    }

    @media (max-width: 767px){
        .carousel p.npn-text {
            position: relative;
            text-align: center;
            right: 0;
        }   
    }

settings_schema.json

Open settings_schema.json and add the following code after each Caption field. Make sure you change the number to correspond with the slide number.
      {
        "type": "textarea",
        "id": "slide-1-npn",
        "label": "NPN Text"
      },   

slider-static-slider.liquid

Open slider-static-slider.liquid

Find the section where variables are assigned and add the following code:

{% assign slide_npn = slide | append: '-npn' %}
Find {% if settings[slideheading] or settings[slidecaption] %} and after the {% endif %} add the following code.
    {% if settings[slide_npn] %}
      {% if settings[slide_npn] != blank %}
        <p class="npn-text">
          {{ settings[slide_npn] }}
        </p>  
      {% endif %}
    {% endif %}

Leave a comment