Your system is now fully operational with users, courses, and roles in place. It is now time to change its look and feel to create a more engaging user experience and ensure compliance with your corporate branding.
There is a wide range of building blocks that impact the look and feel of your Moodle system, as demonstrated in the following diagram:
Figure 7.1 – Moodle’s look and feel components
We have divided Moodle’s look and feel components into three parts, which also form the structure of this chapter:
Tip
Theme creation is not covered in this book as it is not the task of an administrator but a designer with good CSS skills. Moodle Theme Development by Silvina Paola Hillar, Packt Publishing, is a good book to familiarize yourself with the basics of Moodle’s themes and designs.
In this chapter, we will be covering the following main topics:
By the end of this chapter, you will be familiar with Moodle’s visual elements that you can customize via the administrator interface. Before we start customizing the appearance of our site, let’s explore Moodle’s look and feel elements first.
Moodle can be fully customized in terms of layout, branding, and device support. It has to be stressed that certain aspects of changing the look and feel require advanced design skills. While you, as an administrator, can make some adjustments, getting a professional frontend designer involved will be necessary, especially when it comes to styling.
Before covering the three pillars of Moodle’s look and feel, let’s explore some key visual elements. It is not always obvious which page elements can be adjusted via settings (appearance) and which ones require styling (theme). Have a look at the following screenshot of the home page:
Figure 7.2 – Sample home page (Boost theme)
We have highlighted a few selected visual elements and annotated them with a feature that can be customized via appearance settings and one that can be adjusted by the theme (indicated by the color palette symbol). While this list is by no means complete, it hopefully gives you an idea that various elements drive the site’s look and feel. It should also give you an idea about the elements that can be modified via appearance settings and that require theme changes.
In short, appearance (such as home page settings and menu configuration) dictates what content users will see. In contrast, themes are responsible for the design scheme or branding, that is, the header and footer, colors, fonts, icons, and so on.
Now that you are familiar with some key elements of Moodle’s look and feel, let’s get started by customizing the appearance of our site.
We will kick off the customization of your Moodle system by covering its appearance elements. As shown in the overview of the chapter’s introduction, we have divided this part into six elements we will customize: login, home page, my courses, dashboard, user profile, and header.
There are three (and a half) pathways to log in to Moodle. What’s that got to do with the look and feel of the LMS? The chosen workflow potentially impacts the layout and design of the home page because it can be shown before and after login.
Have a look at the pathways shown in the following diagram:
Figure 7.3 – Moodle login pathways
In the standard login workflow that has been activated by default, users navigate to the home page, select the Login link at the top right, log in to the site, and end up at the start page. To jump directly to the Login page, go to <yoursite>/login/index.php. We have discussed various login mechanisms in Chapter 5, Managing Users, Cohorts, and Authentication, when dealing with authentication, including the option to bypass the Before login page and force the Login page.
The second login option is to place the Login block in the block drawer, effectively moving the dedicated login page inside the home page. Once authenticated, the users will be directed to the start page.
The alternate login option is to log in to Moodle from a different website, maybe your organization’s home page, effectively avoiding Moodle’s onboard login screens. To implement this, you will have to add some HTML code on the remote page from which you wish the user to log in:
<form class="loginform" name="login" method="post"
action="https://[yourmoodlesite]/login/index.php">
<p>Username <input size="10" name="username" /> </p>
<p>Password <input size="10" name="password"
type="password" /> </p>
<p><input name="Submit" value="Login"
type="submit" /></p>
</form>
The form will pass the credentials to your Moodle system. You will have to replace the URL of [yourmoodlesite] with the URL of your Moodle instance; this address must be entered in the Alternate Login URL field by navigating to Site administration | Plugins | Authentication | Manage authentication.
By default, authenticated users will see the Dashboard screen after they have logged in. You can change the start page in Site administration | Appearance | Navigation, where you have the option to specify Start page for users. The options are Site, Dashboard (default), My courses, and User preference. If the latter is chosen, users can choose it in the Start page setting in Preferences in their user profiles.
Which login pathway is best depends on your existing infrastructure and personal preference. Whatever option you choose, users will always have access to the home page, which we will customize next.
The home page is identical for all users. Well, its structure is static, whereas its content changes depending on the user who is logged in. For example, every home page might contain a block that displays the courses a user is enrolled in, which is unlikely to be the same for every user. This page is also known as Site home or, for legacy reasons, front page.
As we just mentioned, Moodle’s home page is shown before a user has logged in, and changes after authentication has taken place. The content and layout of the page before and after login can be customized. Look at the following screenshot. It is the same site that was shown in the preceding screenshot, but before a user had logged in:
Figure 7.4 – Sample home page before and after login
In this particular example, the Login block is shown in the block drawer, and Course categories are displayed in the center. Once logged in, the Login block is hidden, the Private files block is shown, the language selector has been replaced with the user profile menu, and two more items appear in the main menu. I am sure you can spot a few more differences!
To change the home page’s appearance before and after login, we need to change the Site home settings.
To customize the home page, select Settings on the home page or go to Site administration | General | Site home | Site home settings:
Figure 7.5 – Home page settings
The following parameters are available on the Site home settings page:
The Moodle home page is treated like a course (internally, it has course ID=1). Therefore, most available settings are identical to their course counterparts: reports, question bank, content bank, filters, and course reuse. The same holds for the Participants menu item: the home page has its own context in which groups can be created, and roles can be assigned to users. This allows a dedicated user to design and maintain the home page without accessing any other elements in Moodle. Since the home page is treated like a course, a Teacher role is usually sufficient.
Moodle provides a great set of tools to customize the home page. Sometimes, you might want to replace this with a custom front page, which we deal with in the following subsection.
To replace the home page, Moodle lets you add a custom script. To implement this feature, you will have to add the following line to your config.php file:
$CFG->customfrontpageinclude="<dirroot>/local/<yourfrontpage>";
Bear in mind that this will display the output of the <yourfrontpage> PHP file at the top of the content area, in addition to any elements of the home page. This way, you have the best of both worlds: the Moodle elements (disable the ones you don’t require) and your custom elements.
While users cannot modify the home page itself, its content is personalized for each user, for example, calendar entries or private files. The same holds for the My courses page, which we will customize in the following subsection.
As the name suggests, the My courses tab shows the courses a user is enrolled in by displaying the Course overview block in the content area (center of the page). In the My courses view, users can star and archive courses; they can also reduce the number of displayed courses they are enrolled in by applying any combination of the following filters:
The following screenshot shows the My courses page I see on my Packt demo system:
Figure 7.6 – My courses view
You can specify appearance settings and available filters by navigating to Site administration | Plugins | Blocks | Course overview. The Display categories setting shows the course category name underneath the course name. You can further customize Available layouts and Available filters. Specifying the Custom field option lets you add your own items to the Status filter, a great way to align the user experience to the subjects taught in your organization.
Figure 7.7 – Course overview block settings
The Future and Past statuses can be adjusted by two grace period settings in Site administration | Appearance | Navigation: Grace period for future courses and Grace period for past courses.
Courses can (and ideally should) have a course image. If the optional picture is missing, it will be replaced with a patterned course card. The colors used in those cards can be specified in Site administration | Appearance | Course card colours:
Figure 7.8 – Course card colors
You can use the standard color picker to select ten colors, which are applied to course images in random order.
In Site administration | Appearance | Courses, some settings let you specify how courses are presented to users and what level of course detail is displayed:
The My courses page is concerned with courses that users are enrolled in. What about navigating through courses and categories users are not enrolled in? We will look at this in the following subsection.
The list of courses seen throughout Moodle can be overwhelming, and it might be difficult for users to navigate through the entire category hierarchy. Examples of where courses and categories are visible to users are the All courses link in the Courses block, by selecting List of categories or Combo list in the site page settings, or through the Courses listing in the Navigation block.
Some settings in Site administration | Appearance | Navigation deal with the level of detail shown in courses and categories. Bear in mind that these mainly apply to the Navigation block and some navigational features in Classic-based themes:
Figure 7.9 – Course navigation settings
Once course selection has taken place – either in My courses or via Navigation – users will be inside a course where two look and feel elements can be configured.
Courses are where learning takes place, and course creators are responsible for their content, structure, and layout. There are two tools that you should set up to ensure an enjoyable experience for your content creators:
To ensure consistency across courses and to simplify course authoring, it is recommended to implement a course templating mechanism. There are two ways such course skeletons can be provided:
The home page and My courses are predefined by the administrator (or a user with appropriate permissions). The intention is that the two pages are static and identical for all users. On the other hand, dashboards and the profile page have been designed to be adjusted by users to match their personal preferences. Let’s look at dashboards next.
Dashboards are like personal home pages that each user can customize. For legacy reasons, this top-level page is sometimes referred to as My Moodle or My home (even the URL is <YOURSITE>/my).
Important note
A dashboard is a personal page that each user can customize.
So, what’s the role of the administrator when users have permission to create their own dashboards? There are two main obligations you have:
Once logged in, users can edit the dashboard by adding blocks to the respective areas and changing any blocks that have already been added by default. They also can reposition certain elements. You, as the administrator, can specify what these default blocks are and where they are positioned, and control how much customization can be carried out. Users can reset the respective pages to these defaults when they customize their dashboards.
By default, the dashboard shows three blocks: Timeline, Calendar, and Recently accessed items. The default Dashboard page can be found by navigating to Site administration | Appearance | Default Dashboard page, where you must switch to Edit mode. Any blocks you place on the default page will appear on the users’ pages. Using the standard Move handle, you can place blocks freely on the page; the allowed locations (left, center, and right) depend on the active theme—more on block handling shortly.
There might be blocks that you wish to display on every page, effectively making them compulsory blocks that cannot be modified or deleted. To facilitate these sticky blocks, go to the block configuration and change the Select pages setting from This specific page to Any page matching the above. The block will appear on all subpages, that is, all user dashboards, and cannot be deleted, effectively making the block sticky.
One impactful feature is Reset Dashboard for all users. As the name suggests, all user dashboards in your system will be reset to your default layout. This action is useful if you have changed the default dashboard and wish to push it out to all users.
To prevent users from editing their dashboard, adjust the moodle/my:manageblocks capability in the Authenticated user role. To completely disable dashboards, untick the Enable dashboards parameter in Site administration | Appearance | Navigation. To prevent guests from accessing the dashboard, you must untick the Allow guest access to Dashboard parameter.
The second page that users can modify is the profile page, where the customization is similar to that of dashboards. Let’s look at it in the following subsection.
The user profile page provides information about the user. We already came across this view when looking at user profile details in Chapter 5, Managing Users, Cohorts, and Authentication.
To change the profile page layout, go to Site administration | Appearance | Default profile page and turn on editing mode. By default, this page is empty, and you can decide which blocks you wish to add, if any.
The information shown on the user profile page (user details, course details, etc.) cannot be changed. These pseudo-blocks are hard-coded and cannot be modified like standard blocks.
There are three capabilities to impact the level of customization of user profiles. These self-explanatory values are shown in the following filtered list of capabilities in the Authenticated user role:
Figure 7.10 – User profile capabilities
We have now covered the main non-course pages in Moodle: Home, My courses, Dashboard, and User profile. A quick summary from a user’s perspective is shown in the following table:
Figure 7.11 – Home vs Dashboard versus My courses versus User profile
There is one key layout element missing: the header.
The Moodle header is shown on every page in Moodle and comprises different navigational elements, as shown in the following annotated toolbar:
Figure 7.12 – Moodle header
The different header items include the following (from left to right), including pointers on where to change their appearance:
<Indent> is a series of hyphens: no hyphens indicate a top-level menu; one hyphen, a submenu; two hyphens, a sub-submenu; and so on. The Boost theme does not support submenus; other themes may overcome this restriction. <Text> is the label of the menu item, <URL> is the internal or external link, and <Tooltip> is the optional balloon help. You can add a <Language> code or a separated list of code as the last item, which will only be shown if the user has currently selected the listed language. ### creates a separator.
Custom 1
- Level 1.1|URL
- Level 1.2|URL
-###
- Level 1.3|URL
Custom 2
- Language 2.1|URL EN||en, en_us
- Sprache 2.1|URL DE||de, de_du, de_kids
- Level 2.2|URL|Shown in Boost
-- Level 2.2.1|URL|Not shown in Boost
-- Level 2.2.2|URL|Not shown in Boost
<Item> is either a text entry (in our example, Custom) or a pair <langstringname><componentname>. The former is the language pack entry, and the latter is the name of the Moodle component, for example, to provide a direct link to edit a user’s profile: editmyprofile,core|/user/edit.php.
This concludes the customizing of appearance pages and the header. Next up are the visual elements that appear across the entire system, starting with blocks.
Every page we have come across so far contains blocks. In fact, bearing a few exceptions, every page in Moodle can contain blocks. You must switch to Edit mode and open the block drawer to configure blocks. Once turned on, you will see the Add a block item, which lets you add all the available blocks to the home page (except the ones that have already been added and only allow a single instance):
Figure 7.13 – Adding blocks to the block drawer
Every block has a purpose usually tied to a particular Moodle feature, for instance, showing deadlines in the calendar, getting access to the user’s private files, or showing the latest announcements. An exception is the Text block that lets you add any HTML code, useful for content that cannot be displayed using standard Moodle blocks.
Throughout the book, we deal with specific blocks whenever they are relevant to the covered topic. Here, we focus on the block configuration.
Blocks have up to three types of settings, which can be accessed through the Configuration icon:
A sample block configuration (of the Mentees block) is shown in the following screenshot:
Figure 7.14 – Block configuration
The following parameters are available:
The concepts of blocks weight and region have been illustrated in the following (block) diagram:
Figure 7.15 – Moodle blocks weight and region
While teachers have permission to configure blocks inside their courses, it often requires some support since the concepts of weight and region are not super-intuitive.
The editor covered next is another visual element that users will use throughout the site.
The editor is central to any user experience in Moodle since it is used throughout the site for a wide range of operations. These include posting in forums (learner), providing feedback to submissions (teacher), and editing content (editing teacher). You, as the administrator, should ensure that the editor is configured to facilitate your users’ requirements.
Moodle’s default editor is called Atto, which has been developed by Moodle for Moodle. Atto has been designed to work with responsive themes, support left-to-right as well as right-to-left strings, provide accessibility support, and is fully configurable.
TinyMCE used to be Moodle’s standard editor, which is still supported but uses an outdated version. Moodle HQ has communicated the following text editor strategy: the latest version of TinyMCE will be incorporated into Moodle, and all Atto plugins will be ported across. Once this process has been completed, Atto is expected to be phased out over future releases. So, in this book, we will only cover Atto since this is currently the best Moodle editor available; soon, you will be dealing with TinyMCE, and all essential features are expected to be available and, hopefully, some more.
Additionally, Moodle contains a built-in plain text editor implemented to enter any text that does not require formatting, for instance, source code.
To get access to the available editors and their settings, go to Site administration | Plugins | Text editors | Manage editors:
Figure 7.16 – Managing text editors
The idea of the Text editors plugin area is that additional editors can be installed and utilized throughout Moodle (refer to Chapter 8, Understanding Moodle Plugins). These can either be replacements for default editors or editors that enter specialized content. Furthermore, each button in Atto is implemented as a Moodle subplugin, which allows for the flexible extension of editor functionality.
Tip
It is recommended that you use Atto as the default editor as this is the one that will be maintained in the future and also fully supports mobile devices.
You can enable/disable each editor, change the order (in which they will be displayed when choosing an editor), and adjust the editor’s settings through the Settings link.
By default, the editor toolbar is configured to look like this (when expanded):
Figure 7.17 – Atto editor toolbar (default)
The toolbar can be configured in the Toolbar config setting under the list of Atto plugins:
Figure 7.18 – Atto toolbar configuration
Toolbar buttons are organized in groups, for example, collapse, style1, and list. Group names must be unique, and the order determines in which order button groups are arranged. The format of each entry is as follows:
group = button1[, button2][,button3][…]
For example, the color group contains two buttons: foreground and background.
When you navigate to Site administration | Plugins | Text editors | Atto HTML editor | Collapse toolbar settings, you can specify via the Show # first groups when collapsed option which buttons are shown when the editor toolbar is not expanded.
You can install Atto’s editor plugins, adding additional buttons to your editor. Examples of moodle.org/plugins/?q=type:atto are word counter, inline corrections, and MS Word import.
Atto autosaves its content in predefined intervals, which is helpful if users close their page by accident since the content will be restored the next time they return to the same form. You can adjust this Autosave frequency setting by navigating to Site administration | Plugins | Text editors | Atto toolbar settings. Beware, a very high frequency, such as a second, will potentially harm the performance of your system.
There exists a wide range of options to expand Atto’s functionality without installing any add-ons:
Figure 7.19 – Filter FontAwesome
Atto is utilized throughout Moodle whenever content has to be entered. So far, we have mainly focused on textual content and ignored multimedia; this is going to change in the following section when we deal with video and audio.
Video and audio content are essential for building engaging learning experiences. Moodle supports playing various media formats as well as the recording of audio and video.
We will cover both modes: first, we will look at media players before dealing with media recorders.
Users nowadays expect to incorporate media formats in their teaching and learning content. Whether it is teachers providing videos as learning resources or learners embedding audio clips in their assignments, it is taken for granted that different media formats are supported. Your job as a Moodle administrator is to ensure that these media files are played correctly.
So how does Moodle handle media content in different formats? In simple terms, every time Moodle detects a link that points to a multimedia resource or <video> and <audio> HTML tags, it replaces them with an appropriate media player code. A multimedia filter is used to facilitate this conversion process (more on filters in Chapter 10, Configuring Technical Features), as shown in the following visualization:
Figure 7.20 – Multimedia filter in action
Moodle does a pretty good job playing media formats, and most setups require little or no tweaking. You can see the players supported in Site administration | Plugins | Media players | Manage media players:
Figure 7.21 – Media players
Out of the box, Moodle uses VideoJS, a popular open source player, supporting HTML5 video, audio, and streaming services, such as YouTube and Vimeo. VideoJS also delivers content to users with accessibility issues. Due to its pluggability and simplicity to style, it has become the de facto standard for web applications. VideoJS is sufficient to play all content unless your users have specific media format requirements.
There are a couple of checks you should carry out to ensure media can be played on your site:
There are various ways to spice up your site with video-related third-party plugins. One highly-recommended example is Video Time (moodle.org/plugins/mod_videotime). The Video Time product family contains a set of plugins to integrate videos into Moodle. Videos can be hosted locally in Moodle, externally, and on YouTube or Vimeo. Supported features are simplified video embedding, an adjustable and customizable tab interface, activity completion, video tracking, resume, interactive transcript, and many more.
In Moodle, everyone can be a content creator. Teachers can record assignment feedback by voice, and students might want to add recorded videos to forum posts. Some users will use their desktop PC or Mac; others might want to use their mobile devices for recording.
Moodle fully supports media recording through its Atto text editor. Internally, RecordRTC is utilized, an open source JavaScript library using WebRTC for audio and video recording. You can configure its settings in Site administration | Plugins | Text editors | Atto HTML editor | RecordRTC:
Figure 7.22 – Media players
The options are worth looking at since they have an impact on server resources, both in terms of bandwidth and disk usage:
Recordings are stored in subdirectories of $CFG->dataroot>/filedir. You might want to double-check the section on files and upload limits in Chapter 2, Exploring the Moodle System.
Important note
Make sure post_max_size and upload_max_filesize are configured in line with your expected maximum recording sizes.
This concludes the section on audio and video. Next up are user tours to assist your learners and teachers while familiarizing themselves the first time they encounter a page or a feature.
User tours allow you to create simple walk-throughs, highlight key areas, or demonstrate new features with on-screen step-by-step guides. The following is a sample mini-tour we are going to create in this section:
Figure 7.23 – Managing user tours
A tour comprises multiple steps, each being associated with a target. A target is a page element that is one of the following three target types:
Each tour step has a title, some content, and a target. Each target is associated with a block, a CSS selector, or the page center. There is no limit to the number of pages in a tour. The structure of a user tour is shown in the following diagram:
Figure 7.24 – User tours overview
Our sample tour contains three steps where the first one is associated with the Appearance menu, which is of target type Selector.
Enough of the theory; let’s create your first user tour.
To get to the user tours feature, go to Site administration | Appearance | User tours. Moodle ships with a number of user tours, which you will see listed. Let’s make our first guide using the Create a new tour button.
Figure 7.25 – Creating a user tour
While Name and Description should be self-explanatory, the other settings require some explanation:
Other useful URLs to match are /my/% (dashboard), /course/view.php% (all courses), /course/view.php?id=x (course with id x), and /user/profile.php% (user profile). To match the home page, the FRONTPAGE value has to be used.
Additionally, you can specify several Tour filters, which are conditions that must be met for the tour to be displayed. The available filters are the following:
A tour comprises multiple steps, simulating a simple walk-through. In the screenshot, you can see the three steps of our Tour of Tours tour:
Figure 7.26 – Tour steps
A step contains the following three main elements:
To display your step in the language the user has selected, use language string IDs, which can be entered once you have selected the option from the Content type menu instead of Manual. The standard format for the language string ID is identifier,component (see the Managing localization section in Chapter 10, Configuring Technical Features, for more details, including how to incorporate images in string texts).
All tours that ship with Moodle make use of the language string feature. Bear in mind that when modifying any of these onboard tours, they may be overridden during the next upgrade.
When you add a new step to your tour via the New step link at the bottom, you will find the mentioned elements on the following form:
Figure 7.27 – Adding a tour step
After saving the form, you can add as many steps to your user tour as required. You can also amend a tour at a later stage or simply modify any existing content. When the structure of the tour changes, Moodle will recognize this and display the tour to all users, including those who have already viewed the previous version. When you only change small parts of the tour, you can use the force the tour to be displayed link at the top of the screen to reset the internal store that records who has already viewed the tour.
Now that you are familiar with creating tours with multiple steps, let’s look at sharing tours by importing and exporting them.
You can download a tour using the Export button in the list of tours. Moodle creates a JSON file that can be imported to another Moodle site. The Import tour button takes you to the standard upload feature of Moodle.
A valuable resource for mostly high-quality user tours is the tour repository. Once you have selected its button, you will be directed to the public User tours site on moodle.net. At the time of writing, there have been approximately 100 user tours in different languages, which might interest you. All you need to do is select the chosen file and click on the JSON filename, which will download the user tour, which you can then load to your Moodle site using the import mechanism already explained. Ensure that the user tour matches your Moodle version to avoid any inconsistencies.
If you feel that you have created a useful user tour that might be of interest to others, feel free to share it in the tour repository. All you need to do is to export your tour and, using your Moodle account, upload it to the repository on moodle.net.
This concludes the section on user tours, the last building block of appearance elements. Next up are Moodle themes, which have an impact across the entire Moodle site.
Moodle provides a flexible skinning mechanism to brand your site to follow corporate design guidelines. As mentioned in the introduction, we will only cover the theme settings that can be accessed from the Moodle administration menu. For details on how to create Moodle themes, refer to Moodle Theme Development by Silvina Paola Hillar, Packt Publishing, or contact your Premium Moodle Partner, who will be able to offer professional theme design services. There are also some good pointers at docs.moodle.org/dev/Themes, which assumes that you have a good understanding of HTML and CSS.
While Moodle supports fixed-width and fluid themes, utilizing (or developing) responsive themes is highly recommended. We exclusively cover responsive themes here.
Important note
The future of e-learning is mobile, as reflected by Moodle, which only ships two responsive themes: Boost and Classic.
Responsive themes automatically adapt to the device, screen resolution, and screen orientation. Additionally, responsive themes adjust to the learning content that is displayed and the navigation that is used. Moodle themes are based on Bootstrap 4 and fully support SASS.
Important note
All modern browsers (the latest versions of Firefox, Edge, Chrome, and Safari) are fully supported by Moodle.
Internet Explorer 11 and other legacy browsers are not supported!
In this themes section, we first select a theme for your site before looking at different theme types. We then customize your theme, a topic categorized in general, advanced, and feature theme settings.
Standard or custom themes can be selected by going to Site administration | Appearance | Themes | Theme Selector. On our site, you can see the two core themes (Boost and Classic) as well as the two most popular third-party themes according to the statistics on moodle.org, Moove and Adaptable:
Figure 7.28 – Theme selection
The new skin will be applied immediately by selecting a theme via the Use theme button. However, some of your users might experience issues after a theme change, so it is recommended to clear theme caches when a new theme has been applied or an existing theme has been updated.
Important note
Ensure that the selected theme is compatible with your version of Moodle. Older themes will not be rendered correctly by the Moodle 4 theme engine.
So far, we have applied a single theme for the entire Moodle system. To apply different themes in different contexts, we need to grasp the concept of theme types, which is the topic of the following subsection.
To understand most theme settings, we require a little bit of background. Like roles, themes are assigned in different contexts: Site (system), User (covering Cohort), Category, and Course. Two additional areas, Session and Page, are supported by Moodle. These theme types are explained in the following table:
Figure 7.29 – Theme types I
The table briefly describes each theme scope and where configuration takes place. As a side note, you can change the precedence order (priority of themes) by modifying the $CFG->themeorder parameter in config.php. The default is set to array('course', 'category', 'session', 'user', 'cohort', 'site'.
To force themes to be applied in different areas, two configurations must be carried out:
The two configurations are shown in the following figure:
Figure 7.30 – Theme types II
There is a trade-off when allowing theme types other than the site theme: while allowing different theme types, additional processing is required that will add some overhead to your system and place an increased demand on your server. However, not allowing these themes limits the level of customization that can be carried out on your site. To assist you in resolving this uniformity versus personalization balancing act, here are some scenarios where the theme selection feature might be helpful:
There are two remaining theme parameters in Site administration | Appearance | Themes | Theme settings that are worth mentioning in the context of theme types:
Now that we have the skill set to work with themes, it is time to customize the existing themes.
As an administrator, you are unlikely to be involved in creating a full-blown custom theme as this task requires strong design skills and deep knowledge of CSS and HTML. However, you will be able to make basic modifications to existing themes.
Theme customizations can be grouped into three categories. While not all themes follow this approach, it gives a good indication of what types of customizations you can carry out via theme settings:
Figure 7.31 – Theme customizations
General settings deal with some basic parameters, images, and colors; advanced settings let you add custom CSS code, and feature settings add new functionality to your system. We are going to cover the three types in the following subsections.
General theme settings let you specify a few basic options, background images, and brand colors. We cover the two core themes (their settings are almost identical) since many custom themes are based on them. Third-party themes will likely have additional settings, for example, more color fields, font sizes, or button styles.
Go to Site administration | Appearance | Themes and select either Classic or Boost, where you can configure the following options:
General theme settings are usually insufficient to style a site to your needs. CSS gives you more flexibility, which we are covering next.
Moodle uses Cascading Style Sheets (CSS) to describe the presentation of each element that is displayed. CSS defines different aspects of the HTML presentation, including colors, fonts, layouts, and so on.
To learn more about theme basics, go to docs.moodle.org/dev/Themes_overview, where you will find a well-documented and detailed help section. Ensure you are familiar with your browser’s Inspect tool to identify CSS styles and attributes.
Moodle uses consistently plain English for the naming of styles. For the login page elements that are displayed in the following two screenshots, a few sample styles have been labeled (original on the left original and modified version on the right):
Figure 7.32 – CSS style samples
You can see that a style represents each element of Moodle. There are literally thousands of styles in Moodle, which gives designers a high degree of freedom.
Moodle supports Sassy CSS (SCSS), a superset of CSS providing additional features such as variables and nesting. SCSS is a preprocessor language that is converted to CSS before it is applied to any site. For the sake of simplicity, we are going to stick to CSS throughout this chapter.
Tip
If you already have any SCSS code or libraries, feel free to use these for your visual customizations.
Any code you wish to inject side-wide should be applied directly in the theme at Site administration | Appearance | Themes | <Theme>. On the Advanced settings tab, you will find two settings that let you override the initial SCSS variables and add new SCSS to themes without modifying any code in the backend: Raw initial SCSS (code injected before any other code) and Raw SCSS (injected at the end of the style sheet). In the following example, we have added three variables to add some weight to all fonts throughout the site:
Figure 7.33 – Advanced theme settings
The second concept we already came across in the general settings is theme presets. According to the developer documentation, a preset is an SCSS file designed to be added to the Boost theme or a child of it. It combines the Bootstrap 4 SCSS files with the required Moodle SCSS files and adds a layer of customization. Preset files can be uploaded into the admin settings for the theme and then chosen from a list of installed presets.
Moodle also supports Mustache templates to render HTML output. For more information on Moodle’s use of Mustache, check out the Moodle developer documentation at docs.moodle.org/dev/Templates.
Technically, you can customize your entire site using SCSS and theme presets. However, unless there are only a handful of adjustments, its usage is cumbersome and its maintenance potentially tricky. Third-party or custom themes overcome this shortcoming and also have the potential to introduce new features.
The beauty of themes is that they can’t just control the look and feel elements but also add new functionality. All popular themes make use of this ability and add new features.
There is a plethora of themes on moodle.org/plugins/?q=type:theme. There are also plenty of design and development companies that offer paid-for Moodle themes via their websites. According to the statistics on moodle.org, the three most popular themes are Moove, Adaptable, and Fordson. To give you an idea of what the configuration options in a professional theme can look like, have a look at the snippet from the Adaptable theme:
Figure 7.34 – Adaptable theme
Just have a look at the sheer volume of menu items! The theme provides a plethora of customization options, ranging from custom menus, front page slide shows, news tickers, and marketing spots to social networking icons and analytics support. Refer to Chapter 8, Understanding Moodle Plugins, for how to install third-party themes.
The topic of themes and customization is hugely complex, and Moodle administrators are usually not involved in the design and branding process. We have covered theme basics that can be customized via the admin interface and, hopefully, this gave you a little insight into the topic. Closely related to theme customization is accessibility, which has to be ensured on your site.
In most educational settings, accessibility is now a legal requirement. So, it is crucial to ensure compliance of your system with the respective standards.
Important note
Accessibility is the ability for users with certain disabilities to access Moodle’s functionality.
An area has been dedicated to Moodle accessibility in Moodle Docs, which you can access at docs.moodle.org/en/Accessibility. It provides useful links to standards, guidelines, legislation, and subject-related tools and resources.
Three main accessibility areas affect accessibility in Moodle:
We will cover all three accessibility types in the following subsections.
Moodle fully complies with major accessibility standards and has obtained WCAG 2.1 level AA Accreditation. Moodle enforces XHTML 1.0 Strict, which only allows the usage of compliant HTML constructs and the implementation of the Moodle forms library. These restrictions guarantee consistency across pages and ensure support for standard screen readers without further configuration.
Moodle provides links to external validation sites, checking the current page for standard compliance. Go to Site administration | Development | Debugging and check the Show validator links box to activate these. Links to Validate HTML and Web Content Accessibility Guidelines (WCAG) check will be displayed at the bottom of your page (if supported by your theme):
Figure 7.35 – Validator links
External validation sites will be opened with the URL as a parameter when selecting the respective links. For the validation sites to be able to check pages on your Moodle system, you need to create a new user with username w3cvalidator and enable guest access to your site. Only do this on a staging or test site since these settings potentially compromise the security of your system.
The validation sites not only check for any page issues but also for theme problems, which are covered next.
CSS is Moodle’s representation layer independent of the system layer, represented in XHTML 1.0 Strict. Thus, accessibility also has to be ensured in the theme itself.
Once you have implemented your accessibility styles, either directly in the theme or through custom CSS, ensure these have been validated against any issues.
One popular choice is to incorporate accessibility options and offer them in the theme as options, such as different color schemes, font styles, text sizes, and readability choices. You can install the Accessibility tool from github.com/sharpchi/moodle-local_accessibilitytool, and the following selection will be available to all users via their Preference menu (if supported by your theme):
Figure 7.36 – Accessibility tool
System and theme accessibility are issues you, as an administrator, have full control over; content accessibility, on the other hand, is more difficult to achieve since you are relying on content creators. How to assist them will be covered in the following subsection.
Accessibility compliance is only guaranteed for Moodle pages (assuming that the theme follows all standards) but not for your teachers’ and instructors’ newly created and uploaded content.
Moodle has some basic built-in tools that assist your content creators:
While these tools provide some basic assistance, they are insufficient in helping content creators to ensure accessibility compliance. To achieve full accessibility conformance, the Accessibility toolkit should be facilitated. To understand the principle behind the tool, have a look at the following diagram:
Figure 7.37 – Accessibility toolkit process
The accessibility toolkit comprises the following steps:
The beauty of the system is that every time content is updated, only the delta of the data is analyzed. This mechanism reduces the load on your Moodle site and performs analyses faster on your server.
As an administrator, you have to ensure that the tool has been configured correctly, which requires the following steps:
Figure 7.38 – Accessibility toolkit settings and review block
The accessibility starter toolkit that ships with Moodle contains some helpful tools to assist content creators in producing accessibility-compliant learning materials. The Enterprise Accessibility Toolkit has a complete set of features to help your organization improve the accessibility of your courses. Check out www.brickfield.ie/brickfield-accessibility-toolkit for details.
This concludes the section on the complex task of accessibility and ends the chapter on configuring Moodle’s appearance.
In this chapter, we tackled the not-so-appealing look and feel of a vanilla Moodle site and touched upon a significant number of areas supporting customization.
We first looked at pages that can be customized by the administrator: login, home, dashboard, my courses, and the user profile. We then covered appearance elements visible or usable throughout the site: the header, blocks, video and audio, the Atto editor, and user tours.
The second part of the chapter was concerned with the customization of themes. Before customizing your theme via general, advanced, and feature theme settings, we looked at different theme types.
The last topic covered was accessibility, a legal requirement in most educational settings. We dealt with system, theme, and content accessibility.
Important note
Double-check what your site looks like when you are not logged in. Ensure no information is visible that should only be accessible to logged-in users.
The main objective of adapting the look and feel of your Moodle system is to ensure a consistent user experience alongside ease of use. However, the level of customization is constrained by two factors, as shown in the following triangle:
Figure 7.39 – Level of customization
The appearance of your site is subject to restrictions, usually the corporate design guidelines of your organization and accessibility regulations. Also, the higher the level of customization, the higher the potential maintenance effort when you upgrade the site to a newer version. It is recommended to consider these aspects when you modify any visual Moodle elements or outsource the task to a Moodle Partner.
Now that your Moodle looks (hopefully) the way you want it to, it is time to enable all the functionalities you wish to offer your users. Plugins are a versatile way to add new features to your Moodle system, which we will deal with in the following chapter.
3.137.217.198