I just added the jQuery module to my CMSMS for the easy slider and a simple slide show.

Here’s how you do it:

1. Download the jQueryTools module for CMSMS. It has a dependant module that you will need to install if you don’t have it (CGExtensions). You can also go to Module Manager in your CMSMS admin and install jQueryTools from there.

2. Upload the jQueryTools module into the modules folder on your web server. Skip this if you added jQueryTools through module manager in your CMSMS admin.

3. Download the slideshow and easyslide JavaScript below. The CMSMS jQuery module comes with some JavaScript for certain functions already, but I had to add these two JavaScript files to make these the easy slider and simple slideshow work:
http://gowright.org/modules/JQueryTools/lib/jquery.slideshow.js
http://gowright.org/modules/JQueryTools/lib/jquery.easyslide.js

4. After downloading the two files, upload them into the modules/jQueryTools/lib/ directory.

5. Then update the action.incjs.php (located in the jQueryTools folder) to call those files into your page. You will need to add these two lines of code around line 65:

$slideshow_files = array(‘main’=>’jquery.slideshow.js’);
$easyslide_files = array(‘main’=>’jquery.easyslide.js’);

You will also need to add the easyslide and slideshow keywords to the $all_lib array and $std_libs (newer JQuery module version) in this file at about line 45 and 46:
$all_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’slideshow’,’easyslide’);
$std_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’slideshow’,’easyslide’);

6. Add the following smarty tags in the head of your template to activate jQuery on your site:
{JQueryTools action=incjs}
{JQueryTools action=ready}

7. Add you html in your page. Here is a smaple:

<img class=”active” title=”Frank Lloyd Wright” src=”uploads/images/home/frank-lloyd-wright-home-and-studio.jpg” alt=”Frank Lloyd Wright” width=”537″ height=”245″ /><img class=”last” title=”Frank Lloyd Wright’s Robie House” src=”uploads/images/home/frank-lloyd-wright-robie-house.jpg” alt=”Frank Lloyd Wright” width=”537″ height=”245″ />

Note: the first image should have have a class “active” and the last “last.”

Voila! You have a working jQuery easy slider and simple slide show.

Here is the CSS for the slideshow (You will have to adjust the CSS tho to make it pretty):

#banner {
position:relative;
height: 262px;
width: 658px;
}

#banner IMG {
position:absolute;
top:0;
left:0;
z-index:8;
opacity:0.0;
}

#banner IMG.active {
z-index:10;
opacity:1.0;
}

#banner IMG.last-active {
z-index:9;
}

I have recently updated my sample because I needed to add links to the images.

10 Replies to “jQuery and CMS Made Simple”
  1. Don’t forget to create a Boolean array.

  2. Hi there,

    The demo looks fantastic! I am so excited to try this on my CMS, and I’ve followed every step, but I have a question.

    In your first sentence:
    “I just added the jQuery module to my CMSMS for the easy slider and a simple slide show.”

    I clicked the two links in your sentence and downloaded:
    1. simple-jquery-slideshow.zip and
    2. easyslider1.7.zip

    I am not sure where to UPLOAD these files in the CMS – sorry if this is a silly question, but I do so want this to work.

    So far I have this error message on the test page: “string(121) “Smarty error: [in tpl_head:45 line 4]: syntax error: unrecognized tag ‘JQueryTools’ (Smarty_Compiler.class.php, line 590)” string(121) “Smarty error: [in tpl_head:45 line 5]: syntax error: unrecognized tag ‘JQueryTools’ (Smarty_Compiler.class.php, line 590)” ”

    I am not sure how to fix this, but am thinking it might be solved once I upload the two folders mentioned above.

    Can you please help?

    Many thanks for your instructions above.

    Mooshie

  3. Hi Mooshie,
    If you are using CMS Made Simple you can download the jQuery module here. Unzip the file JQueryTools folder and then upload it into your modules folder. Or you can install the module by logging in to admin then goto “extensions” “module manager.”

    Then download easy slider and a simple slide show. Save these files as “jquery.easyslide.js” and “jquery.slideshow.js.” Upload them into “modules/JQueryTools/lib.”

    Hope this helps.
    Stephanie

  4. Thank you for your sharing,
    the only question left is where to put the images?
    Is there a special folder?

    Louis-Philippe

  5. Here is my completed slideshow: http://gowright.org/

    You can put your images wherever you like. Just link to them in your html and use your css to style. View the code on this page to see it.

  6. One more thing , you have to add the easyslide and slideshow key word to the $all_lib array in the action.incjs.php (located in the jQueryTools folder) to get cmsms to output the correct js file links

    Line 45
    $all_libs = array(‘base’,’tablesorter’,’cluetip’,’form’,’fancybox’,’json’,’cgform’,’slideshow’,’easyslide’);

  7. Thanks Colman. I missed that. Added it to the original blog.

  8. Know that you need CGextensions for this.

  9. Thank you for a great tutorial, I read your others with great interest, but…having followed every step to the ‘T’ my site simply displays two images one above the other!! One thing I didn’t understand was step 3? In one breath you say download the easyslider and slideshow javascript and then you say but use these two files instead, or do you mean in addition too? I downloaded v1.7 of the easyslider javascript but this contains two javascript files and I don’t know where to put them? Do I use your files or the ones downloaded from the easyslider site??

    Your help would be greatly appreciated.

    Many thanks.

  10. Hi Mark,
    Please feel free to use my javascript files linked in step number 3. I have added some copy to make that a little clearer. If you still need to trouble shoot, double check your css file and make sure everything is correct. And make sure if you are copying any html from my blog to retype the quote marks. Hope this helps!

Comments are closed.