Customizing your front page

Moodle's front page changes after a user has logged in. 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 the preceding screenshot was taken from but before a user had logged in:

Customizing your front page

In this particular example, the Login block is shown on the left-hand side and the Course categories and Courses as well as a course search box are displayed in the center, as opposed to the list of available courses. Additionally, the Administration block is not displayed.

Bear in mind that some implementations may not have an unauthenticated view. This is the case if a single sign-on mechanism has been implemented.

The front page settings

In order to customize the front page (go to Front page | Front page settings), you either have to be logged in as the Moodle administrator, or you have been granted front page-related permissions in the Front page context:

The front page settings

The following parameters are available on the Front Page settings page:

Setting

Description

Full site name

This is the name that appears in the browser's title bar. It is usually the full name of your organization or the name of the dedicated course or qualification that the site is used for.

Short name for site

This is the internal name of your site that is used at various places, for instance, as part of the backup name or when networking the site.

Front page summary

This description of the site will be displayed on the front page, through the Site description block. The description text is also picked up by the Google search engine spider, if allowed.

Front page

Moodle can display up to five elements in the center column of the front page when not logged in: News items, List of courses, List of categories, Combo list (this displays categories and courses), and Course search box. The order of the elements is the same as the one chosen in the pull-down menus.

Front page items when logged in

This is the same as Front page but it's used when a user is logged in. A sixth item is provided to be displayed, namely, Enrolled courses, which shows a list of courses that the user is enrolled into. That view does not make any sense before the user has been authenticated with Moodle.

Maximum category depth

When course categories are shown, this setting specifies how many levels of the hierarchy are displayed. It is useful to limit this if your category hierarchy's depth is greater than three or four.

Maximum number of courses

This shows the number of courses that are shown on the front page. If more courses are available, a link to More courses is shown.

Include a topic section

If ticked, an additional topic section (just like the topic block in the center column of a course) appears on top of the front page's center column. It can contain any mix of resources or activities that are available in Moodle. It is very often used to provide information about the site or to include an image or video.

News items to show

This includes a number of news items that are displayed.

Comments displayed per page

This setting dictates how many entries are shown if the Comments block is used on the front page. This setting really belongs to the Comments block and might be moved in the near future.

Default front page role

If logged-in users need to be allowed to participate in front page activities, a default front page role should be set. The default is Authenticated user on the front page.

Front page settings mainly dictate what is displayed in the center of the page. Now, let's have a look at the blocks on the left-hand side and the right-hand side of the page.

Arranging front page blocks

To configure the left-hand side and right-hand side column areas with blocks, you have to turn on editing in the Front page settings area of the Administration block. Once turned on, you will see the Add a block block, which contains all the available blocks that can be added to the front page (except the ones that have already been added and only allow a single instance):

Arranging front page blocks

Blocks are added to the front page in exactly the same way as courses. To change their position, use the Move icon. Some blocks have settings that are unique to that block and which can be accessed through the Configuration icon. For example, the Navigation block allows you to specify whether the block can be docked and how certain types of content are displayed:

Arranging front page blocks

In addition to block-specific settings, every block contains two sets of parameters that control its behavior. The two sections, Where this block appears and On this page, will be shown for every block:

Arranging front page blocks

A block, like a role, can be assigned in a context (here, Front page) and its properties are inherited and overridden in subcontexts. The first set of settings specify where the block will be displayed and what the default properties are. The second set of settings specify the properties in the current context. The following parameters are available:

Setting

Description

Original block location

This shows the context in which the block has been created. This is sometimes referred to as the home context. As with roles, pages may inherit blocks from a parent context.

Page contexts

(not in all contexts)

This setting dictates on which pages the block will be shown; the options that are available are:

  • Display on front page only
  • Display on the front page and any pages added to the front page
  • Display throughout the site

In other contexts, such as Courses, other (context-sensitive) options will be shown, depending on the original block location and your current location.

Display on page types

(unavailable on the front page)

The options that are available depend on the context that the block is shown in, for example, Only user profile pages and My home page in the User context, or Any page, Any course page, and Any type of course main page in Courses.

Default region (Left, Right)

This determines whether the block's position is on the left-hand side or on the right-hand side.

Default weight (-1010)

Think of a block as a balloon: the lighter the weight of the block, the higher up its position, and the heavier the weight, the further down it will be placed.

Visible (Yes, No)

This determines whether the block is shown or hidden.

Region (Left, Right)

This is the same as Default region. On My Home and other profile pages, content is offered as a third option (refer to the default Dashboard and Profile pages section further along).

Weight (-1010)

This is the same principle as Default weight.

In the preceding screenshot, the block is shown in the right-hand column in the first position. However, when it is displayed on any other page, the block is initially shown on the left-hand side and has a weight of -5.

The Main menu block allows the addition of any installed Moodle resource or activity inside the block. For example, using labels and links to (internal or external) websites, you are able to create a menu-like structure. Another block that has proven popular on the front page is Online users, which displays a list of everybody who's currently logged in to your Moodle site. The HTML block lets you add any HTML code, which is useful for any type of content that cannot be displayed using standard Moodle blocks.

Tip

The Navigation and Administration blocks cannot be deleted via the standard menu. If you need to hide them on the front page, set Visible to No in the Configuration settings.

If the Include a topic section parameter has been selected in Front page settings, you have to edit the area and add any installed Moodle activity or resource. This topic section is usually used by organizations to add a welcome message for visitors, which is often accompanied by a picture or other multimedia content.

Tip

Double-check what your site looks like when you are not logged in. Make sure no information is visible that should only be accessible to logged-in users.

Logging in from a different website

The purpose of the Login block is for users to authenticate themselves by entering their credentials in the form of a username and password. It is possible to log in to Moodle from a different website, maybe your organization's home page, effectively avoiding Moodle's front page and the Login block. 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="http://www.mysite.com/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 username and password to your Moodle system. You will have to replace www.mysite.com with your URL; this address has to be entered in the Alternate Login URL field by navigating to Plugins | Authentication | Manage authentication.

Other front page items

The Moodle front page is being treated as a standalone component in Moodle and has, therefore, been given a top-level menu with a number of features that can all be accessed through Front page settings in the Administration block:

Other front page items

We have already looked at Front page settings; now, let's take a brief look at the other available options. Since the front page is treated like a course (internally, it has course ID of 1), a number of settings are available, which are identical to their course counterparts.

Front page users

The front page has its own context in which groups can be created and roles can be assigned to users. This allows a separate user to develop and maintain the front page without having access to any other elements in Moodle. Since the front page is treated as a course, a Teacher role is usually sufficient for this. It is possible to upload users as teachers in the front page with a CSV file using the site's short name as the course1 field, teacher in the role1 field and, if required, the chosen group name in the group1 field).

We discussed this feature in detail in the previous chapter, which dealt with the management of roles.

Front page filters

Any filters that have been activated can be configured at the course level. The same applies to the front page. We will discuss filters in detail in Chapter 9, Moodle Configuration, when we look at different configuration settings.

Front page reports

These are identical to course reports. We will be looking at these options in Chapter 10, Moodle Logging and Reporting.

The front page backup and restore

The front page has its own backup and restore facilities to back up and restore any elements of the front page, including any content. The mechanism of performing a backup and restore is the same as course backups, which is dealt with in Chapter 13, Backup and Restore.

Like all other course backups, front page backups are stored in the User backup folder of your user file (System/<your name>/Userbackup).

Front page questions

Since the Moodle front page is treated in the same way as a course, it also has its own question bank, which is used to store any questions used in front page quizzes. For more information on quizzes, question types, and the question bank, go to Moodle Docs at https://docs.moodle.org/en/Quiz_activity.

The default Dashboard and Profile pages

There are two special pages that users are able to customize themselves. These are the Dashboard page—we came across this in the introduction—and the Profile page.

Once logged in, users will have the ability to edit these pages by adding blocks to the respective areas and changing any blocks that have already been added by default. They also have the ability to reposition certain elements. You, as the administrator, have the ability to specify what these default blocks are, where they are positioned, and control how much customization can be carried out. When users customize their Dashboard or Profile page, they also have the ability to reset the respective pages to these defaults.

The two default settings can be found by navigating to Appearance | Default Dashboard page and Appearance | Default profile page, respectively. Once on the page, you have to click on the Blocks editing on button. Any blocks that you place on the default pages will appear on the users' pages. Interestingly, using the standard Move icon, you can place blocks in the center column! It is a shame that the same functionality does not (yet) exist on the front page or even in courses, by default, as shown in the following screenshot:

The default Dashboard and Profile pages

Not only that, you can also make blocks sticky. These are blocks that you wish to display on every page, effectively making them compulsory blocks that cannot be modified or deleted. To facilitate this, the block settings have to be extended with the Select pages setting, which is shown in the properties of any block in Default Dashboard page (take a look at the block settings, which were discussed earlier). If set to Any page matching the above, the block will appear on all those subpages and cannot be modified, effectively making the block sticky. The same mechanism applies to the default profile page.

To prevent users from editing their Dashboard and Profile pages, change the moodle/my:manageblocks and moodle/user:manageownblocks capabilities in the Authenticated user role, respectively.

Customizing navigation

There are a number of settings that impact how your users will navigate your site, regardless of whether they are on the Site home page, their Dashboard, or inside a course. This takes place when you navigate to Appearance | Navigation:

Customizing navigation

The vast majority of these mostly self-explanatory settings deal with the level of detail that is shown in courses and categories in the Navigation block as well as some related blocks.

The subject of displaying courses and categories comes up regularly when customizing Moodle sites. The common cause for concern is that the list of courses seen on the screen is overwhelming, and it will be difficult for users to navigate through the entire category hierarchy.

Tip

Only you, as the administrator, can see the long list of all the courses and categories. Users will only see the courses they are enrolled in.

Bearing this in mind, there are a number of ways that the entire category structure can be exposed to users:

  • Through the All courses link in the Courses block, unless the Hide all courses link option has been checked by navigating to Plugins | Blocks | Courses. Here, you can also specify that the admin will only see their own courses.
  • By selecting List of categories or Combo list in the front page settings.
  • Through the Courses listing in the Navigation block. This is controlled by the settings seen in the preceding screenshot.

The users that are shown alongside the course description. This is related to the way in which courses and categories are presented to the user. By default, this is only users with the Teacher role. You can change this via Course contacts by navigating to Appearance | Courses. Here, you can also specify a further number of useful settings:

Customizing navigation

Courses per page is a threshold setting that is used when displaying courses within categories. If there are more courses in a category than specified, the page navigation will be displayed at the top of the page. Also, when a combo list is used, course names are only displayed if the number is less than the specified threshold. For all the other categories, only the number of courses is shown after the category name.

Course authors have the ability to enter a course summary. This usually contains a textual description, but it can also contain files, for example, the curriculum as a PDF. You limit the number of courses with the summary shown on the front page via the Courses with summaries limit setting. By default, only one file can be attached; you might need to increase this Course summary files limit. In the preceding screenshot, we have also added the PDF format as a valid Course summary files extensions.

Replacing the front page

As we have seen so far, Moodle provides us with a great set of tools to customize the front page. Sometimes, though, you might want to replace this with a custom front page. The home page of https://moodle.org/ is a good example of where this has been implemented successfully.

Moodle lets you add a custom script to the front page. 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 front page. This way, you have the best of both worlds: the Moodle elements (disable the ones you don't require) and your custom elements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.27.171