We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23849
    • 223 Posts
    Hi All,

    I am using a jquery plugin that sets the images for the slideshow in the head of the document as an array like so:

    <script type="text/javascript">
    var photos = [ {
        "title" : "",
        "image" : "Slide_1.jpg",
        "url" : "#issue",
        "firstline" : "",
        "secondline" : ""
    },
    {
        "title" : "",
        "image" : "Slide_2.jpg",
        "url" : "#mission",
        "firstline" : "",
        "secondline" : ""
    },
    {
        "title" : "",
        "image" : "Slide_3.jpg",
        "url" : "#artists",
        "firstline" : "",
        "secondline" : ""
    }
    ]; 
    var slideshowSpeed = 6000;
    </script>


    I’m calling Gallery in the head of my document like so:
    <script type="text/javascript">
    var photos = [ [[!Gallery? &album=`[[*pagetitle]]` &thumbTpl=`HomeGalleryTpl`]] ]; 
    var slideshowSpeed = 6000;
    </script>
    


    And HomeGalleryTpl reads:
    {
        "title" : "",
        "image" : "[[+name]]",
        "url" : "[[+url]]",
        "firstline" : "",
        "secondline" : ""
    },
    


    The issue is the comma at the end of each item in the array. I need to be able to specify the last item’s TPL so it doesn’t have a comma at the end, as commas at the end of arrays break the slideshow in Internet Exploder.

    Is there any way of extending Gallery to include a new parameter called "FinalTpl" that can format the last item?

    Let me know, thanks!
      Nick Hoag
      Creative Partner
      The FutureForward

      http://thefutureforward.com