Vorlage:Zum Übersetzen

Wie installiere ich ein neues Design?

  1. Entpacken Sie die .zip Datei des Designs lokal in einem leeren Verzeichnis.
  2. Laden Sie dieses Verzeichnis in das Verzeichnis moodle/theme/[Design-Name] auf den Moodle-Server hoch (ersetzen Sie [Design-Name] durch den Namen des Designs, das Sie installieren wollen). Stellen Sie sicher dass dieses Verzeichnis auf dem Moodle-Server für den Webserver-Nutzer les- und schreibbar ist (chmod 755 - Besitzer: read/write/execute, Gruppe: read/execute, Alle: read/execute). Falsche Dateirechte können dazu führen, dass das Design nicht dargestellt wird.
  3. Wählen Sie das neue Design in Moodle aus: Einstellungen > Website-Administration > Darstellung > Designs > Design-Auswahl.

Wie installiere ich ein neues Design mittels cPanel?

  1. Laden Sie die .zip Datei des Designs mittels cPanel auf Ihren Moodle-Server hoch.
  2. Entpacken Sie mittels cPanel das neue Design im Verzeichnis /moodle/theme. Es wird ein Unterverzeichnis /moodle/theme/[newtheme] erzeugt, wobei [newtheme] der name des neuen Designs ist.
  3. Stellen Sie sicher dass dieses Verzeichnis auf dem Moodle-Server für den Webserver-Nutzer les- und schreibbar ist (chmod 755 - Besitzer: read/write/execute, Gruppe: read/execute, Alle: read/execute). Falsche Dateirechte können dazu führen, dass das Design nicht dargestellt wird.
  4. Wählen Sie das neue Design in Moodle aus: Einstellungen > Website-Administration > Darstellung > Designs > Design-Auswahl.

Warum erscheint das neu installierte Design nicht in der Design-Auswahl von Moodle?

Sie haben vermutlich irgend etwas bei der Installation übersehen. Im folgenden wird beschrieben, wie Sie ein neues Design aus dem vorhandenen Standard-Design erzeugen:

  1. Kopieren Sie das Verzeichnis /moodle/theme/standard und nennen Sie das kopierte Verzeichnis /moodle/theme/new.
  2. Im Verzeichnis /moodle/theme/new/lang/en benennen Sie die Datei theme_standard.php um in theme_new.php.
  3. Öffnen Sie die Datei /moodle/theme/new/lang/en/new.php und ändern Sie folgende zwei Zeilen:
    1. $string['pluginname'] = 'Neues Design - Martin D';
    2. $string['choosereadme'] = 'Neues Design ist eine Kopie des Standard-Designs und wurde von Martin D im Jahr 2011 geändert';
    3. Speichern Sie die Änderungen.
  4. In der Datei /moodle/theme/new/config.php ändern Sie die Variable $THEME->NAME = 'new'.
  5. In der Datei /moodle/theme/new/version.php ändern Sie die Variable $plugin->component = 'theme_new'.
  6. Gehen Sie auf die Seite Einstellungen > Website-Administration > Darstellung > Designs > Einstellungen und markieren Sie die Checkbox Designbearbeitungsmodus. Speichern Sie die Änderung.
  7. Gehen Sie auf die Seite Einstellungen > Website-Administration > Darstellung > Designs > Design-Auswahl.
    1. Klicken Sie auf den Button Design-Cache löschen.
    2. Wählen Sie das neue Design aus.

Wie beschränke ich die Design-Auswahl für Nutzer/innen und Kurse?

  1. Gehen Sie auf die Seite Einstellungen > Website-Administration > Darstellung > Designs > Einstellungen.
  2. Tragen Sie die Namen der Designs, die Sie für Nutzer/innen und Kurse zur Verfügung stellen wollen, im Textfeld Designliste ein.

Wie erstelle ich ein eigenes Design?

Siehe Theme development - Entwickler-Dokumentation.

Kann ich einen Kurs in einem bestimmten Design darstellen?

Ja. In den Kurseinstellungen können Sie bei der Option Festgelegtes Design ein Design auswählen.

Voraussetzung dafür ist, dass die Moodle-Administration auf der Seite Einstellungen > Website-Administration > Darstellung > Designs > Einstellungen die Checkbox Kursdesigns erlauben markiert hat.

Wie erreiche ich, dass in meinem selbsterstellten Design Links in einem neuen Fenster geöffnet werden?

It is possible to create your own fly out menu via the custom menu block in Settings>Site administration>Appearance>Themes>Theme settings. Copy the examples given below the box. If you want the links to open in a new window, use the following code:

Moodle|http://www.moodle.org" target="_blank"

Where shall I put my custom CSS code?

Note that the standard themes Afterburner, Arialist, Formal White, Fusion, Nonzero, Overlay, Sky High and Splash all offer the possibility to add custom CSS in their page settings via Settings>Appearance>Themes>.

Failing this, instead of modifying the theme's CSS files you better put your own code in a separate CSS file and make your theme aware of that file by modifying its config.php file (be sure add your own CSS file as the last one in the list so that you will override all prior settings). See this posting for detailed instructions.

See also the instructions on creating your own theme mentioned above.

Will I lose my courses, language files, logo, etc. if I switch my theme?

Switching themes only changes the appearance of your site, not the content within it. The logo is a part of the theme and will be lost when you switch.

Follow these instructions to add a logo to a theme.

If you upgrade your Moodle site and tweaked an existing standard theme, you will lose your changes. Thus it is a good idea to create a custom theme which will not be changed when you upgrade.

I can't access theme files on the server. Can I still add a logo to a theme?

Yes. You have two choices:

    • Either upload your logo to another place publicly available online and then copy the image's URL to paste into the logo field of the theme page you are editing (such as Afterburner)
    • Or add the main menu block to your front page; upload the logo via Main menu>Add a resource. Get its URL and paste it into the logo field of the theme page you are editing. You can safely then hide or delete the main menu block; the logo will still be there. (NOTE - your logo will appear in Navigation>Site pages as well.)

Are there tools which help me creating and editing themes?

Clear Cache Button

This useful Firefox add-on let's you add a button to your tool bar for easily clearing your cache while working on your theme: https://addons.mozilla.org/de/firefox/addon/1801

Please note that the following tools are only for development. They only change the way you see your Moodle site, not the Moodle site itself. Any changes you make using these tools will not be visible to anyone else who uses your site. For this you will have to make those changes permanent by changing your theme's CSS files for example.

Firebug

The single most useful tool is the Firebug add-on for the Firefox web browser. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... And there are additional add-ons for making Firebug an even more powerful tool.

Firebug enhancements

You can enhance Firebug even further. See Firebug for more information.

Web Developer Toolbar

Another great tool for any web developer is the Web developer extension, another Firefox add-on. One very useful feature is the option to disable your browser's cache while working on your theme. That way you are sure you're always presented with your latest modifications and not with an older, cached version.

Now also available for Google's Chrome browser: "The Web Developer Toolbar Comes to Chrome"

Stylish

Modifications made with Firebug are lost when refreshing your page. If you want your CSS changes to be a bit more permanent, for example to try them with different pages of your Moodle installation, you can use another Firefox plugin: Stylish. That way you can change your site's CSS with a simple mouse click without having to change Moodle code.

See Stylish for detailed instructions and examples.

Stylish-Custom

This is an custom additions to the Stylish extension which brings back features from 0.5.9 and adds new features.

How do I check for cross-browser compatibility?

There are some tools (standalone and online) which can show you how your site looks in different browsers. See this forum discussion for details. See the new device detection settings in Theme settings which will allow you to create a theme for those "special" browsers.

How are the device types used in Moodle 2.2 ?

If "Enabled device detection" has been turned on, Moodle 2.2 will automatically use the theme which has been set for the device in the Theme selector settings page. It is also possible to add additional types to the Theme selector page by using the "device detection regular expressions" fields.

Site administrators can find these enable device detection settings in Site administration > Appearance >Themes > Theme settings .

Concrete examples for modifying Moodle themes

The following examples were taken from the former Theme Scrapbook:
"The Moodle Theme Scrapbook is a collection of small how-to descriptions. You theme designers and Moodle users working with themes add your knowledge here to help new Moodle users with tips and tricks for their theme work.
Feel free to add to this list! Don't know how? Read our Guidelines for contributors."

Changing things

Colors

Logo and icons

Layout

Adding things

Hiding things

Moving things

Miscellaneous

How can I see theme changes when using the Windows Complete Installer package

In the Windows Complete Installer package, the eAccelerator in the XAMPP install can cause some issues with changes to your theme's CSS and HTML files from showing.

Open the php.ini file inside of the server\php folder from your install in notepad and search for "eAccelerator" you should see a line that reads:

extension=eaccelerator.dll

Insert a semi-colon (turns the line into a comment) at the start of this line so it now reads:

;extension=eaccelerator.dll

Restart the Moodle server using the "stop moodle" and then the "start moodle" programs in your server folder. You should now find that all of your changes to your CSS are reflected as soon as you save the file and refresh your browser cache (usually you can refresh your cache by pressing F5). This FAQ from a discussion at Deactivating caching with XAMPP installations

Siehe auch