This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


I'm looking for the ability to put something in the scripts placeholder, but only if it's not been put there before.

Case point for a carousel partial that might be used multiple times on a page:

<div class="glider">

{% put scripts %}
    {% once %}
        <script src=""></script>

            window.addEventListener('load', function(){
                new Glider(document.querySelector('.glider'), {});
    {% endonce %}
{% endput %}

There is no feature like this, but the addJs/addCs functions do eliminate duplicate scripts from being added programmatically. There are no promises but this could work

{% do this.controller.addJs('') %}

Fair play - thank you - I'll try it out

1-3 of 3

You cannot edit posts or make replies: the forum has moved to