For your own JavaScript, it is best to create a separate file and include it in the theme.
Placing elements with your own insert tag
The page ODD Elements contains articles that you can include anywhere on your website with an insert tag.
To get to the articles, click Articles in the left menu and scroll all the way down.
In the article settings (wrench icon) of the article, select the matching Theme Helper Tag under Template settings.
You can then add the article with the following insert tag in an HTML element or template, e.g. {{theme::content::ODD01/01}}.
You find the header content in the articles under ODD Elements > 01 / Kopfzeile.
Customizing the logo
You replace the logo in the article 01/01 Logo.
Customizing contact details and social media links
You find the contact details and social media links in the article 01/02 Top Navbar, where you can change them.
Choosing between a straight or slanted header
How to activate the straight header is explained on the page Layouts.
Customizing the footer
You find the footer content in the articles under ODD Elements > 02 / Fußzeile.
These articles are included in the modules Footer / Main and Footer / Copyright.
Customizing colors and fonts
After installing the theme, you find the SCSS files in the file manager under the path
odd/scss.
Depending on the installed theme version, there are two ways to make your own customizations:
Older theme versions:
You use the files
custom.scss (for SCSS and CSS)
_custom_colors.scss (to change the base colors and choose a color scheme)
_custom_variables.scss (for more detailed adjustments such as fonts or colors of individual elements)
To change a variable, remove the comment characters (slashes) in front of the line in the respective file.
Newer theme versions:
As of the latest version there are no SCSS variables anymore, only CSS variables.
In addition, _custom_colors.scss was merged into _custom_variables.scss – so you only find one file named
_custom_variables.scss. There you can adjust all color and other variables.
Here, too, you have to uncomment the lines to activate changes.
In both cases you can still add your own SCSS or CSS in custom.scss.
Tip
If the SCSS file was not edited with the Contao editor but uploaded with an FTP program, you have to purge the
script cache under System maintenance in the Contao back end and, if necessary, reload the page with Ctrl + F5.
Note
Do not rename the theme folder odd in the file manager, otherwise the SCSS files will no longer be loaded.
You do not have to include the files in the page layout yourself, the theme already loads them automatically.
Color schemes
By default the ODD theme comes with a light layout and a green primary color. You can also choose
other color schemes:
Light color scheme / green primary color
Light color scheme / blue primary color
Light color scheme / red primary color
Light color scheme / yellow primary color
Light color scheme / purple primary color
Light color scheme / pastel colors
Dark color scheme
All of the color schemes above are adjusted for high contrast to ensure good readability and accessibility.
In addition there is a green, blue and grey color scheme that is not adjusted for high contrast. These come from
an earlier theme version and are still included for backward compatibility.
To switch to a different color scheme, uncomment the corresponding line under Colour Schemes in _custom_variables.scss
(or _custom_colors.scss in the older theme version) by removing the slashes. You may need to reload the page with
Ctrl + F5 for the change to take effect.
Important note
If you use the latest version of the ODD theme, you may wonder where _custom_colors.scss has gone.
Don’t worry: as of ODD version 3.7.0, a new installation of the ODD theme only has
_custom_variables.scss, which now contains all color and variable definitions.
What this means for you:
v2 (new installation from version 3.7.0): A new installation of the theme only has
_custom_variables.scss with all color and variable settings. Use CSS variables for your customizations.
v1 (version older than 3.7.0 / update from a version older than 3.7.0): If you updated the ODD theme
or installed a version older than 3.7.0, both _custom_variables.scss and _custom_colors.scss remain.
Use SCSS variables for your customizations.
Tip
ℹ️ How do I update my existing installation to the new version with CSS variables?
As of version 3.7.0 the ODD theme was thoroughly adapted for accessibility.
If you want to use all current and future features, you should switch to the new version.
You find a detailed guide here: Update to CSS variables.
In our theme you can adjust many styles via CSS variables. They are already prepared in the stylesheet,
but commented out by default (with //). To activate or override a variable, simply remove the
// at the beginning of the line.
📁 Where to find the variables
You find the file for adjusting the variables in the file manager under odd/scss/_custom_variables.scss.
and generate the matching @font-face CSS code right away.
Important: Under “Customize Folder prefix”, enter the path to your fonts folder, e.g. /files/odd/fonts/.
📄 Example: adding the CSS to _custom_variables.scss
Copy the generated CSS code from the website (e.g. for the font “Ubuntu”) and paste it at the very top of
_custom_variables.scss:
By default the ODD theme comes with a slanted header. To activate the straight header, select a layout with a straight header in the page settings.
Among the modules there is a navigation module for the slanted and the straight header (Navigationsleiste mit Schräge and Navigationsleiste ohne Schräge), which is included in the respective layouts.
Under Themes > Page layouts various layouts for one-, two- and three-column layouts with a slanted or straight header are already created, which you can assign in the page settings under Layout settings.
FAQ
Images
Why is an image not displayed?
The folder in the file manager may not be set to public. You can check this by editing the folder.
Public must be ticked, otherwise the image is not displayed in the front end.
Why doesn’t the large view of an image open in a lightbox when I click it?
The theme has to load jQuery and the jQuery template j_colorbox. You can edit the layout in the back end under Themes
via the third-to-last icon Edit the page layouts of theme ID 1.
Why are animated GIFs not displayed?
For animated GIFs, do not set an image size in the image settings, otherwise the animation is lost.
How do I add my own image to the social media icons in the header?
In the article 01/02 Top Navbar (at the very bottom under ODD Elements - 01/Kopfzeile), create a new element
of type Image inside the content container (see screenshot 1).
In the element settings, set an image size, e.g. Fit the frame / 40px. Activate
Overwrite metadata and set a link under Image link address. In the expert settings, also set
the class icon (see screenshot 2).
Finally, add the following CSS code to
custom.scss.
In the end it should look like the third screenshot.
Screenshot 1:
Screenshot 2:
Screenshot 3:
How do I define a second logo for the narrow navigation bar?
In the article 01/01 Logo (under ODD Elemente - 01 / Kopfzeile), add a second image element and give it
e.g. the class stuck-logo (the second input field under Expert settings).
A different logo should now be displayed when you scroll down from the top and the narrow navigation bar
appears.
Why are some images not displayed? (WEBP support)
If newer browsers try to load a WEBP image and it is not supported, an error may occur.
The error message may look something like this:
request.CRITICAL: Uncaught PHP Exception RuntimeException: "Image format "webp" is not supported in Imagine\Imagick\Imagine on this environment. Consider removing this format from contao.image.valid_extensions or switch the contao.image.imagine_service to an implementation that supports it.
Possible solutions:
#1 Update Imagine or have your host do it (use the latest version)
#2 Use an alternative image processing service
You can specify a different image processing service in config.yml; afterwards the cache has to be cleared.
This often solves the problem already. If WEBP is supported, you should also be able to select it in the image sizes.
How do I change the read-more link of events or translate it into other languages?
You can either edit the template event_list_odd.html5 or event_teaser_odd.html5 directly or override it in
langconfig.php (only from ODD theme version 1.4.2).
Edit the file langconfig.php under system/config, or create it if it does not exist yet.
You can override the text with the following line:
Or as follows to override it e.g. in a specific language:
<?php
if ($GLOBALS['TL_LANGUAGE'] == 'en') {
$GLOBALS['TL_LANG']['odd']['event_more_link'] = "Details";
}
Display
How do I remove the slanted edges?
Removing the slanted edges in the header
There are already several layouts to switch between a straight and a slanted header. Among the modules
there is also a navigation module with and without a slant, which you can select in the layout under the included
modules.
Removing the slanted edges of content elements
The page Elements with slanted edges shows how to
adjust the slanted edges of content elements. You only have to remove the classes skw-**.
Removing the slanted edges in the footer
Edit the module Footer / Main and remove the class skw-tr.
Removing the slanted edges of the newsletter area
For the newsletter area above the footer, edit the module Newsletter / Abonnieren / Startseite
and remove the class skw-tl under Expert settings.
How do I prevent all headings from being displayed in uppercase?
Add the following CSS to custom.scss
and then reload the page with Ctrl + F5:
How do I remove the newsletter area above the footer?
You can deactivate the newsletter area in the corresponding page layout under Included modules with the eye icon
or remove it with the cross.
Other
How do I show a Google Maps map?
Install the extension Google Maps.
In the back end you then find a menu item Google Maps where you can create your map.
With a content element (Media elements -> Google Map) you include the map at the desired place in an
article.
You can enter the API key in the settings under Google Maps.
This is what it could look like:
How do I prevent the theme CSS file from being cached?
Visitors who have already visited the website are usually served a cached file. If you want to prevent this,
you can adjust the fe_page template.
Adjust the following template: fe_bootstrap_odd.html5.
To prevent the CSS file from being cached, you can append a timestamp to the file name, for example. In the
line echo $combiner->getCombinedFile(); ?>">, insert the following before the quotation marks:
?date=<?= time() ?>
If several domains in one Contao installation should use the ODD theme, this is possible with a few
workarounds.
The goal of this guide is for each domain to have its own custom.scss, _custom_colors.scss and
_custom_variables.scss.
Note
As of Contao 4.12 the publicly accessible subfolder was renamed from /web to /public. If your installation has
a /web directory, use web instead of public in the following code examples.
1) Create the SCSS files
Create a folder in the file manager under odd/scss (e.g. domain2). Copy the files
custom.scss, _custom_colors.scss and _custom_variables.scss into this folder.
In _custom_colors.scss, adjust the path of the color schemes as follows.
Go to Themes and Edit the page layouts of the theme and duplicate any
layout. Edit the layout and select the fe_page template you just created under Expert settings (at the very bottom)
in Page template.
4) Assign the layout to the page
Finally, assign the layout to a page (Layout settings -> Assign a layout).
5) ODD Elements
In the article settings of the header and footer content (under ODD Elements) you can select the corresponding page
under Template settings so that the content of this article is actually used.
Update to CSS variables
With version 3.7.0 the ODD theme was made accessible and all SCSS variables were switched to CSS variables.
This means a manual intermediate step is necessary when updating from an older version (< 3.7.0) to a newer version (≥ 3.7.0).
Requirements
Existing installation of the ODD theme < 3.7.0
Update to Contao 5
1. Update the theme
Open the Contao Manager.
Update the ODD theme to 3.7.0 or higher (recommended: latest version).
2. Changes to the SCSS files
As of version 3.7.0 the file _custom_colors.scss no longer exists.
All color definitions are now in _custom_variables.scss.
After the update to 3.7.0 or higher the site still works, but not all new features are available right away.
You should therefore create the current theme files.
Complete re-import of the theme folder
In the file manager, rename the folder odd, e.g. to odd-alt.
In the Contao Manager, open System maintenance → Check database and run the database update.
The migration that creates the new theme files is now offered – run it.
A new folder odd with the current files is created.
Moving images:
If there were images in the old odd folder, move them either into the new folder or into a separate image folder.
References are kept if the images were added in Contao via “Add an image”.
4. Transfer your own customizations
If you made changes in custom.scss, _custom_colors.scss or _custom_variables.scss, you have to transfer them manually to the new files.
Important: V2 uses CSS variables instead of SCSS variables.
Example color variable
Before (V1 – SCSS):
$oddColor1:#b6cf92;
New (V2 – CSS variables):
:root{--oddColor1:#b6cf92;}
CSS variables are used in code like this:
color:var(--oddColor1);
5. Update SCSS customizations
If your custom.scss still uses SCSS variables ($variable),
change them to the CSS variable format (var(--variable)).
Example:
/* Vorher */color:$oddColor1;/* Neu */color:var(--oddColor1);
Accessibility
You find detailed tips, new features from version 3.7.0 and best practices for accessible design here:
♿ Accessibility in the ODD theme
If you want to adjust the files manually, the odd folder must also contain an empty file named .v2 to activate the V2 structure.
Accessibility
Accessibility in the ODD theme (version 3.7.0 and later)
With version 3.7.0 the ODD theme was thoroughly revised with regard to accessibility and switched to CSS variables.
To use these features, a manual intermediate step is necessary when updating from an older version (< 3.7.0) to a newer version (≥ 3.7.0).
➡️ Guide: Update to CSS variables
1. New accessible templates (version 3.7.0 and later)
To avoid redundant links (e.g. image, headline and button all linked), it is enough to link only the button.
This improves keyboard navigation.
Adapted templates are available for various content elements such as teaser box, content box etc.
These templates have the suffix _bf (German “barrierefrei”, accessible).
2. General accessibility tips
When creating content, pay attention to the following: