Wednesday, June 26, 2013

How I created a rotating image slider for the Educator theme on my coursepage

 successfully created a rotating slider for my Moodle 2.5 site based on the excellent post by Gerrard Shaw on his blog:

Gerrard's post made reference to the JQuery plugin named Easy Slider 1.7 found here:
If you follow Gerrard's instructions, you will be able to have an image slider in any part of your theme or coursepage. The instructions are top notch, as Gerrard explains the steps very well. I would advise you to read Gerrard's post thoroughly first. This post helps to give you the full picture.
For example, it took me quite a while to get the slider working on my site. One reason is that Gerrard forgot to mention that the easyslider.css file, found inside the styles folder, has code at lines 61 and 64 that need to be customised according to your website if you want your theme to display the "next and previous image" icons.
In the image below, I have typed in the exact location of the prev and next buttons on my Moodle 2.5 production site. Without this editing, the slider's next image and previous image buttons will not show up.

Extract file inside the main moodle folder. Do not extract the contents inside the theme folder!You will end up with <main moodle folder>/pix/<image files>and<main moodle folder>/pix/slider/<more files>
For your convenience, I've also made available for download the complete Educator theme folder with the necessary slider files inside it. The zip file also contains the necessary demo slide images. When extracted, all necessary files to make the slider work on the theme, are in place.
The educator zip file contains the theme files (for my site with my banners and image stuff) plus the necessary slider code and files.
Lastly, I create an instance of the slider by using this HTML code inside a Moodle label resource
<div id="slider">
<li><a href=""><img src="" alt="Image 01" /></a></li>
<li><a href=""><img src="" alt="Image 02" /></a></li>
<li><a href=""><img src="" alt="Image 03" /></a></li>
<li><a href=""><img src="" alt="Image 04" /></a></li>
<li><a href=""><img src="" alt="Image 05" /></a></li>

Well that's it! Now you can create your own image slider for your own theme. 

RegardsFrankie Kam

If you like this post or site
a small donation would be nice but would last only a day,
otherwise leaving a comment (or a compliment) below will last me a month!

No comments:

Post a Comment

Ratings and Recommendations by outbrain