Difference between revisions of "Theme directory"

From Learnit docs
(Redirected page to Theme directory)
(Tag: New redirect)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
#REDIRECT [[Theme_directory]]
 
 
{{Themes}}In the standard Moodle distribution, all themes are placed in the theme/ directory.
 
{{Themes}}In the standard Moodle distribution, all themes are placed in the theme/ directory.
  
Line 6: Line 5:
 
== Change themes default directory for site ==
 
== Change themes default directory for site ==
  
The storage location of themes may be altered, using the variables ''$CFG->themewww'' and ''$CFG->themedir''. Themes from placed in the directory specified by these variables will then be available for selection using the theme selector.
+
The storage location of themes may be altered, using the variable ''$CFG->themedir''. Themes from placed in the directory specified by this variable will then be available for selection using the theme selector.
  
For example, should you wish to place themes in a subdirectory called 'my_moodle_themes', your config.php might look like this:
+
For example, should you wish to place themes in a subdirectory called 'my_moodle_themes', your 'config.php' file might look like this:
 
<pre>
 
<pre>
 
$CFG->wwwroot  = 'http://my.moodle.site.edu';
 
$CFG->wwwroot  = 'http://my.moodle.site.edu';
 
$CFG->dirroot  = '/var/www/my.moodle.site.edu/public_html';
 
$CFG->dirroot  = '/var/www/my.moodle.site.edu/public_html';
$CFG->themewww  = $CFG->wwwroot . '/my_moodle_themes';
 
 
$CFG->themedir  = $CFG->dirroot . '/my_moodle_themes';
 
$CFG->themedir  = $CFG->dirroot . '/my_moodle_themes';
 +
</pre>
 +
 +
or any place that you have configured to be readable by your web server, for example:
 +
 +
<pre>
 +
$CFG->wwwroot  = 'http://my.moodle.site.edu';
 +
$CFG->dirroot  = '/var/www/my.moodle.site.edu/public_html';
 +
$CFG->themedir  = '/home/me/my_moodle_themes';
 
</pre>
 
</pre>
  

Latest revision as of 14:52, 11 June 2021

Template:ThemesIn the standard Moodle distribution, all themes are placed in the theme/ directory.

More information about the content of a typical theme directory/folder can be found in Theme basics

Change themes default directory for site

The storage location of themes may be altered, using the variable $CFG->themedir. Themes from placed in the directory specified by this variable will then be available for selection using the theme selector.

For example, should you wish to place themes in a subdirectory called 'my_moodle_themes', your 'config.php' file might look like this:

$CFG->wwwroot   = 'http://my.moodle.site.edu';
$CFG->dirroot   = '/var/www/my.moodle.site.edu/public_html';
$CFG->themedir  = $CFG->dirroot . '/my_moodle_themes';

or any place that you have configured to be readable by your web server, for example:

$CFG->wwwroot   = 'http://my.moodle.site.edu';
$CFG->dirroot   = '/var/www/my.moodle.site.edu/public_html';
$CFG->themedir  = '/home/me/my_moodle_themes';

Theme directory for Developers

Developers should follow the Theme directory guide

See also

fr:Dossier de thèmes ja:テーマディレクトリ de:Design-Verzeichnis