Adaptable News Slider

Blocks ::: block_news_slider
Maintained by Manoj Solanki, Jez H, Kevin Moore
Part of set Adaptable UI.
Part of the Adaptable UI set, this block allows you to add a news slider that displays: 1: Unread course announcements (from all enrolled courses) 2: Site announcements (front page news announcements) 3: Both of the above (combined course and site announcements) The slider uses the jQuery slick slider and whilst designed to work with the Adaptable Theme, it *may* work with other themes.

Adaptable News Slider 1.3.3.1

Moodle 3.7, 3.8
Released: Friday, 24 April 2020, 5:32 PM

README

moodle-block_news_slider

Moodle News Slider

A news slider that displays unread course announcements and site announcements. Can also be used on course pages to show unread announcements for that specific course.

General configuration

  • Configurable max length of excerpt
  • Configurable max length of subject
  • Configurable to use caching for the user session plus cache expiry time

Per instance configuration

  • Option to display site news or course news or both
  • Maximum number of site / course announcements to display
  • Maximum period (in days) to show site / course announcements for
  • Display link to older news items
  • Show bullet (dots) navigation on bottom of slider
  • Adjust the height of the slider (in px)
  • Support for RTL languages, such as Hebrew & Arabic

Guidelines for use

You may want to experiment with the general configuration settings. E.g. for wider displays, you could increase max lengths and vice-versa. Please note that caching is switched on by default and set to expire every 5 minutes (300) for a user session by default.

Using the slider on course pages

There is custom block region on course pages in the Adaptable theme called "course page slider region", designed for use with the news slider.

See basic instructions below:

  1. Add the news slider to the "Course slider" block region that can be seen by admins on the frontpage. Configure it to appear on all pages.
  2. Go to any course page. You should the news slider appear just above course content. Now configure this block to appear only on course pages.

Customising colour and styling using CSS

You can customise various parts of the slider using CSS, such as the banner colour, font size, type etc. You can use the developer tools of Chrome and Firefox for example, to find out the name of the css selectors that need to be modified. Below are some examples to get you started.

Slider left banner colour

A common requirement is to change the default colour of the left banner from orange, to one that matches the colours of the site. This can be done using css, as per the below example. In this case it changes it to a blue.

.slider-banner-col { background-color: #0066CC; }

Example CSS to change various styling elements of the slider

.slider-banner-col {
    background-color: #FF0000; /* Change banner background colour */
}

/* This is the text displayed inside the left banner */
.slider-banner-col span {
    color: #ffe968;   /* Change text colour */
    font-size: 26px;  /* Change font size */
}

/* !important is required in this case to override it correctly */
.news-slider .slick-dots li button:before {
    font-size: 18px !important;
    color: red !important;
    opacity: 1;  /* To make it a solid colour */
}

Version number

Version 1.3.3.1 (2020042001)

How do I get set up?

Installs at /blocks/news_slider

Settings

Site-wide configuration options are available under: Site Administration -> Plugins -> Blocks -> News slider

Per Instance block settings are available by editing block configuration.

Dependencies

Adaptable Theme version 2017053100 (1.4+)

Compatibility

  • Moodle 3.7, 3.8
  • Adaptable version 1.4+

Known issues

When the slider is used with Adaptable tabs, or anything similar, it is possible that when changing tabs and going back and forth, the slider will render slides all the way down the page momentarily in a messy fashion. This appears to be due to how the slick js works internally. A way around it is to inser code like the following within the custom JS section of Adaptable settings (sample shown for Adaptable tabs):

<script type="text/javascript"> 
if (typeof $('.responsive').slick === "function") {
    $("#coursetabcontainer :radio").on("change", function() {
        $('.responsive').slick('setPosition');
    });
$("#dashboardtabcontainer :radio").on("change", function() {
        $('.responsive').slick('setPosition');
    });
}
</script>

Contribution

Developed by:

  • Manoj Solanki (Coventry University)
  • John Tutchings (Coventry University)

Co-maintained by:

  • Jeremy Hopkins (Coventry University)

    Licenses

Adaptable is licensed under: GPL v3 (GNU General Public License) - http://www.gnu.org/licenses

Version information

Version build number
2020042001
Version release name
1.3.3.1
Maturity
Stable version
MD5 Sum
0758bf124e1d7e154aade3633dc3bebd
Supported software
Moodle 3.7, Moodle 3.8
  • Latest release for Moodle 3.7
  • Latest release for Moodle 3.8

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS branch
https://bitbucket.org/covuni/moodle-block_news_slider/branch/version-1.3.3.1-2020042001

Default installation instructions for plugins of the type Blocks

  1. Make sure you have all the required versions.
  2. Download and unpack the block folder.
  3. Place the folder (eg "myblock") in the "blocks" subdirectory.
  4. Visit http://yoursite.com/admin to complete the installation
  5. Turn editing on in any home or course page.
  6. Add the block to the page
  7. Visit the config link in the block for more options.