Fork me on GitHub

Adding pagevars from template  Bottom

  • I need to add some java to the header of the site. I tried it like this:

    Code

    <!-- pagevars -->



    /***********************************************
    * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
    ***********************************************/



    var mygallery=new fadeSlideShow({
        wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
        dimensions: [468, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
        imagearray: [
    <!--[foreach from=$banner item=bannerinfo name=checked]-->
    ["<!--[$bannerinfo.imageurl]-->", "<!--[$bannerinfo.clickurl]-->", "", ""<!--[if $smarty.foreach.checked.last]-->]

    <!--[else]-->],<!--[/if]--><!--[/foreach]-->
        ],
        displaymode: {type:'auto', pause:5000, cycles:5, wraparound:false,randomize:true},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 1000, //transition duration (milliseconds)
        descreveal: "ondemand",
        togglerid: ""
    })
    <!-- /pagevars -->

    Which works, but it puts the stuff in the wrong place. This is for the fading banner display I have on the Church's site. It adds the code, and the block works, but it doesn't put it in the header area, and as a result, there's some invalid markup. Some of the code, as you can see, is generated by Smarty logic, so I can't just make it an external javascript file, needs to be done from the template, so how do I do this right?

    --
    Home Page | Find on Facebook | Follow on Twitter
  • rawtext pagevar in a plugin. put your js in a seperate template and call it from the plugin into a var. then add via pageutil
  • Okay, so the same way you did the js plugin for Postcalendar, just calling the template rather than a .js?

    --
    Home Page | Find on Facebook | Follow on Twitter

This list is based on users active over the last 60 minutes.