Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: Theme settings.

Theme settings: Difference between revisions

From MoodleDocs
(→‎hideactivitytypenavlink: setting removed in 2.0)
(→‎Allow category themes: extra info copied from http://moodle.org/mod/forum/discuss.php?d=209119)
 
(20 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Themes}}
{{Themes}}
Location: ''Administration > Appearance > Themes > Theme settings''
== Theme settings ==
An administrator can change theme settings in ''Settings > Site administration > Appearance > Themes > Theme settings''.


[[File:Themesettings.png]]


== Theme settings ==
===Theme list===
 
===''themelist''===
This lists the themes available for course and user themes. Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you may specify a comma-separated list of names, though don't use spaces (e.g. standard,orangewhite).
This lists the themes available for course and user themes. Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you may specify a comma-separated list of names, though don't use spaces (e.g. standard,orangewhite).


*Site themes which are listed can be previewed and chosen via Site Administration block> Appearance > Themes >Themes selector.  
You can  preview the available themes in ''Settings > Site Administration > Appearance > Themes > Themes selector.''


*Older versions will find the available site themes via Site Administration block > Configuration > [[Themes]].
===Theme designer mode===
Turn this on if you are designing and testing themes as it will stop the themes being cached and enable you to see theme changes quickly. (You can also do this with the Clear theme cache button on the theme selector page.)


===Allow user themes===
If the option ''allowuserthemes'' is enabled, each user may select their preferred theme on the edit profile page. All Moodle pages will be displayed in the user's theme, apart from courses where a course theme has been set.


===''allowuserthemes''===
===Allow course themes===
If enabled, then users will be allowed to set their own themes through their [[Edit_profile#Preferred_theme|Edit Profile]] page. User themes override site themes but not if the course setting is [[Course_settings#Force_Theme|Force theme]].
 
*If the option ''allowuserthemes'' is enabled, each user may select their preferred theme on the [[user/edit|Edit profile]] page. All Moodle pages will be displayed in the user's theme, apart from courses where a course theme has been set.
 
===''allowcoursethemes''===
If you enable this, then teachers will be able to set their own course themes. Course themes override all other theme choices (site, user, or session themes).
If you enable this, then teachers will be able to set their own course themes. Course themes override all other theme choices (site, user, or session themes).


*If the option ''allowcoursethemes'' is enabled, each editing teacher may select their course theme via the Force theme option on the [[course/edit|Course settings]] page. The course will always be displayed in the theme specified in the course setting, with user and the site themes being overwritten.
*If the option ''allowcoursethemes'' is enabled, each editing teacher may select their course theme via the Force theme option on the [[course/edit|Course settings]] page. The course will always be displayed in the theme specified in the course setting, with user and the site themes being overwritten.


===''allowcategorythemes''===
===Allow category themes===
{{Moodle 1.9}}When enabled, themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.
When enabled, themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance, as it will result in a few extra DB queries on each page, so only turn this on if you need it!
*In Moodle 1.9 onwards, category themes may be set. There is an admin setting to turn this feature on/off under "Site Administration/Appearance/Themes/Theme settings". It is off by default as it does take a bit of processing overhead. If it is switched on then you will be able to select a theme when editing categories. The theme will then apply to all courses in that category or child categories and the category page itself.


===''allowuserstohideblocks''===
===Allow theme changes in the URL===
*If this is checked then the theme may be changed by adding <code>?theme=theme_name</code> (or <code>&theme=theme_name</code> if there are other URL parameters) to the URL in the browser. Theme names should be in lower case with spaces replaced by underscores, for example the theme "Formal white" should be entered as <code>?theme=formal_white</code>
 
===Allow users to hide blocks===
Allows users to display and hide blocks
Allows users to display and hide blocks


===''showblocksonmodulepage''===
===Allow blocks to use the docks===
If activity module allows blocks, this will enable a pulldown list.
*If the theme allows it, then checking this will allow the user to move blocks to the side dock.
 
===Custom menu items===
The custommenuitems setting allows you to create a drop down menu that can be displayed by themes that support it. Currently all themes that are provided with Moodle 2.0 support this custom menu.
 
You are able to create the custom menu by entering custom menu items one per line into the setting. Each item is preceded by a number of hyphens (-), the number of hyphens determines the depth of the item. So items that are '''NOT''' preceded by a hyphen appear on the top level of the menu (always visible), items with a single hyphen appear on a drop down menu below the previous top level item, and  items with two hyphens appear on a drop down menu below the previous first level item and so on.


===''hideactivitytypenavlink''===
The content of each item is constructed of up to three bits, each separated by a '''|''' (Shift + \) character. The bits are '''label''' | '''url''' | '''tooltip'''.
Will allow the teacher to hide an activity type in the navigation bar.
; label : This is the text that will be shown within the menu item. You must specify a label for every item on the menu.
*{{Moodle 1.9}}In Moodle 1.9, it is possible for the teacher to hide an activity type, for example Quiz crumb, in the navigation bar from students or all users. This would prevent the user from seeing a list of other activities.
; url : This is the URL that the user will be taken to it they click the menu item. This is optional, if not provided then the item will not link anywhere.
; tooltip : If you provide a URL you can also choose to provide a tooltip for the link that is created with the URL. This is optional and if not set the label is used as the tooltip for the menu item.


This setting has been removed in Moodle 2.0 (see MDL-22427).
The following is an example of how you would create a custom menu:


==New settings for Moodle 2.0==
<pre>
*Theme designer ''modethemedesignermode''
Moodle community|http://moodle.org
*Allow theme changes in the URL ''allowthemechangeonu''
-Moodle free support|http://moodle.org/support
*Allow blocks to use the dock ''allowblockstodock''
-Moodle development|http://moodle.org/development
--Moodle Tracker|http://tracker.moodle.org
--Moodle Docs|https://docs.moodle.org
-Moodle News|http://moodle.org/news
Moodle company
-Moodle commercial hosting|http://moodle.com/hosting
-Moodle commercial support|http://moodle.com/support
</pre>


Note: The custom menu does not escape characters within the label, if you want to use a special HTML character such as an ampersand you must escape it yourself within the label. e.g. use &amp; instead of &.
For more information on this setting please see the ''Using Moodle'' forum discussion [http://moodle.org/mod/forum/discuss.php?d=149803 Moodle 2.0: Custom menu in core]
==== Multilanguage support ====
You can add a language code (or a comma separated list of codes) as the 4th item of the line. The line will be then printed if and only if the user has currently selected the listed language. For example:
<pre><nowiki>
English only|http://moodle.com|English only item|en
German only|http://moodle.de|Deutsch|de,de_du,de_kids
</nowiki></pre>
===Enable device detection===
Will detect mobile and tablets that identify themselves via the web browser at the time of login to Moodle.  These work with the theme selector.  When the theme selector has identified a default, mobile and tablet themes, this feature will use that theme.
===Device detection regular expressions===
This will allow you to customize the theme selector options.  For example, you can add a custom theme for IE6 and another for Windows CE by entering the identifying expressions the browser sends and the "Return value" you want to display as the theme selectors "Device type".


==Special themes==
==Special themes==
Line 88: Line 119:
|}
|}
(* except courses with the course theme set)
(* except courses with the course theme set)


=== Change default  hierarchy===
=== Change default  hierarchy===
In Moodle 1.9 onwards, the priority of themes can be set via the /moodle/config.php file. The order defines which theme wins when there are several set at different levels. You can set a variable called $CFG->themeorder (see config-dist.php for more details). By default it is set to:  
The priority of themes can be set via the /moodle/config.php file. The order defines which theme wins when there are several set at different levels. You can set a variable called $CFG->themeorder (see config-dist.php for more details). By default it is set to:  


<code><nowiki>$CFG->themeorder = array('page', 'course', 'category', 'session', 'user', 'site');</nowiki></code>
<code><nowiki>$CFG->themeorder = array('page', 'course', 'category', 'session', 'user', 'site');</nowiki></code>


==Particular theme settings==


Logo, tagline, link colour, column width, custom CSS and other settings for a particular theme may be set by an administrator in ''Settings > Site administration > Appearance > Themes > Theme name''.


==See also==
==See also==
*How to change [[Header logo]]
 
*[[Theme scrapbook]] has more information about themes
*[http://www.youtube.com/watch?v=mCVsJ3Wsoj8 Video demonstrating how to set a category theme in Moodle 1.9]
*[http://www.youtube.com/watch?v=mCVsJ3Wsoj8 Video demonstrating how to set a category theme in Moodle 1.9]
[[Category:Themes]]


[[es:Configuración de temas]]
[[es:Configuración de temas]]

Latest revision as of 15:31, 17 August 2012

Theme settings

An administrator can change theme settings in Settings > Site administration > Appearance > Themes > Theme settings.

Themesettings.png

Theme list

This lists the themes available for course and user themes. Leave this blank to allow any valid theme to be used. If you want to shorten the theme menu, you may specify a comma-separated list of names, though don't use spaces (e.g. standard,orangewhite).

You can preview the available themes in Settings > Site Administration > Appearance > Themes > Themes selector.

Theme designer mode

Turn this on if you are designing and testing themes as it will stop the themes being cached and enable you to see theme changes quickly. (You can also do this with the Clear theme cache button on the theme selector page.)

Allow user themes

If the option allowuserthemes is enabled, each user may select their preferred theme on the edit profile page. All Moodle pages will be displayed in the user's theme, apart from courses where a course theme has been set.

Allow course themes

If you enable this, then teachers will be able to set their own course themes. Course themes override all other theme choices (site, user, or session themes).

  • If the option allowcoursethemes is enabled, each editing teacher may select their course theme via the Force theme option on the Course settings page. The course will always be displayed in the theme specified in the course setting, with user and the site themes being overwritten.

Allow category themes

When enabled, themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance, as it will result in a few extra DB queries on each page, so only turn this on if you need it!

Allow theme changes in the URL

  • If this is checked then the theme may be changed by adding ?theme=theme_name (or &theme=theme_name if there are other URL parameters) to the URL in the browser. Theme names should be in lower case with spaces replaced by underscores, for example the theme "Formal white" should be entered as ?theme=formal_white

Allow users to hide blocks

Allows users to display and hide blocks

Allow blocks to use the docks

  • If the theme allows it, then checking this will allow the user to move blocks to the side dock.

Custom menu items

The custommenuitems setting allows you to create a drop down menu that can be displayed by themes that support it. Currently all themes that are provided with Moodle 2.0 support this custom menu.

You are able to create the custom menu by entering custom menu items one per line into the setting. Each item is preceded by a number of hyphens (-), the number of hyphens determines the depth of the item. So items that are NOT preceded by a hyphen appear on the top level of the menu (always visible), items with a single hyphen appear on a drop down menu below the previous top level item, and items with two hyphens appear on a drop down menu below the previous first level item and so on.

The content of each item is constructed of up to three bits, each separated by a | (Shift + \) character. The bits are label | url | tooltip.

label
This is the text that will be shown within the menu item. You must specify a label for every item on the menu.
url
This is the URL that the user will be taken to it they click the menu item. This is optional, if not provided then the item will not link anywhere.
tooltip
If you provide a URL you can also choose to provide a tooltip for the link that is created with the URL. This is optional and if not set the label is used as the tooltip for the menu item.

The following is an example of how you would create a custom menu:

Moodle community|http://moodle.org
-Moodle free support|http://moodle.org/support
-Moodle development|http://moodle.org/development
--Moodle Tracker|http://tracker.moodle.org
--Moodle Docs|https://docs.moodle.org
-Moodle News|http://moodle.org/news
Moodle company
-Moodle commercial hosting|http://moodle.com/hosting
-Moodle commercial support|http://moodle.com/support

Note: The custom menu does not escape characters within the label, if you want to use a special HTML character such as an ampersand you must escape it yourself within the label. e.g. use & instead of &.

For more information on this setting please see the Using Moodle forum discussion Moodle 2.0: Custom menu in core

Multilanguage support

You can add a language code (or a comma separated list of codes) as the 4th item of the line. The line will be then printed if and only if the user has currently selected the listed language. For example:

 English only|http://moodle.com|English only item|en
 German only|http://moodle.de|Deutsch|de,de_du,de_kids

Enable device detection

Will detect mobile and tablets that identify themselves via the web browser at the time of login to Moodle. These work with the theme selector. When the theme selector has identified a default, mobile and tablet themes, this feature will use that theme.

Device detection regular expressions

This will allow you to customize the theme selector options. For example, you can add a custom theme for IE6 and another for Windows CE by entering the identifying expressions the browser sends and the "Return value" you want to display as the theme selectors "Device type".

Special themes

Session themes

Moodle offers an additional way to set a theme - the session theme. This is set with the URL and lasts until you log out. When you next login, the site/course/user themes are active again. This option is great for theme testing and works perfectly when you want to enable different themes for different situations.

For example you can offer a special link for PDA users and integrate the session theme orangewhitepda in that link. Nobody needs to change any settings, you just click on that link. The session theme is called by the URL parameter &theme=orangewhitepda. The whole URL without the session theme could look like http://mymoodlesite.org/course/view.php?id=18 and with the parameter for the PDA theme like "http://mymoodlesite.org/course/view.php?id=18&theme=orangewhitepda".

In a standard Moodle installation, session themes are not active. To activate them the administrator must add the parameter $CFG->allowthemechangeonurl = true; to the Moodle config.php file in the Moodle base directory.

Page theme

A page theme is for special page-only themes set by code.

Theme hierarchy

Here is the usual order that themes are considered by the Moodle interface.

Theme type Overwrites Display Setting type
Site - all pages* saved in theme profile
User Site theme all pages* saved in user profile
Course Site, user and session themes one course saved in course profile
Session Site and user themes all pages* temporary until logout

(* except courses with the course theme set)

Change default hierarchy

The priority of themes can be set via the /moodle/config.php file. The order defines which theme wins when there are several set at different levels. You can set a variable called $CFG->themeorder (see config-dist.php for more details). By default it is set to:

$CFG->themeorder = array('page', 'course', 'category', 'session', 'user', 'site');

Particular theme settings

Logo, tagline, link colour, column width, custom CSS and other settings for a particular theme may be set by an administrator in Settings > Site administration > Appearance > Themes > Theme name.

See also