Please disregard the 'View article...' shown at the bottom of many posts as this is the result of restoring old forum posts from a backup.

How do I load carousel.js from the bootstrap for a custom slide show?

In order to avoid duplicate bootstrap .js files and problems with them:
how do I load carousel.js from the bootstrap for a custom slide show?

Sorry, if the answer is already somewhere in docs or forum. I was trying to find but didn't see anywhere the answer.
I'm especially talking about the newest Exp 2.3.0 with patches.


View article...

Comments

  • That'd be the {script} smarty block. Looks like I hadn't updated the docs page to include the 'bootstrap' param available in v2.3.0+ http://docs.exponentcms.org/docs/2.3.0/script, but just like yui & jquery, you add a 'bootstrap' parameter with the list of bootstrap scripts you want loaded (without the .js suffix nor the 'bootstrap-' for bs v2.x). In this case the code would look like:

    {script unique=bscarousel bootstrap='carousel'}
    {literal}
    // no code needed if blocks are set up per bootstrap docs
    {/literal}
    {/script}


    View article...
  • Since I need to put it into t smarty block, I guess I would need to add a .tpl file there by all means? My carousel is coded straight into the front page sub theme called front.php, so I'm not tailoring any module for it.


    View article...
  • OK, we can use the php equivalent of the above sample ('content' param not needed here, but it's where the javascript code goes)...

    expJavascript::pushToFoot("unique"=>'bscarousel ","bootstrap"=>''carousel'',
    "content"=>"// no code needed if blocks are set up per bootstrap docs", );


    View article...
  • Actually
    expJavascript::pushToFoot(array("unique"=>'bscarousel ","bootstrap"=>''carousel'',
    "content"=>"// no code needed if blocks are set up per bootstrap docs") );


    View article...
Sign In or Register to comment.