1.3 Subthemes

This section shows you how to use subthemes in the Goobi viewer.

Goobi workflow

A new metadata ViewerSubTheme must be added to the ruleset. This is then also added to DocStructs that have the CatalogIDDigital metadata configured as a mandatory metadata.

The relevant parts from the ruleset are:

    <language name="de">Alternative Darstellung</language>
    <language name="en">Alternative view</language>

<!-- [...] -->

<metadata num="1o" DefaultDisplay="true">ViewerSubTheme</metadata>

<!-- [...] -->


<!-- [...] -->


In the configuration file goobi_metadataDisplayRules.xml a drop-down menu with the desired subtheme names is assigned:

<context projectName="*">
    <select1 ref="ViewerSubTheme">
        <item selected="true">
            <value />
        <item selected="false">
            <label>Mein Subtheme</label>

Goobi viewer Indexer

The metadata viewerSubTheme is written to a separate field within the Solr Index. The following field definition must be added to the configuration file:


<!-- [...] -->


Goobi viewer Core

The following adjustment must be made in the Goobi viewer Core to ensure correct evaluation:

    <theme mainTheme="reference" 
           discriminatorField="MD2_VIEWERSUBTHEME" />


In the file template.html the following block is added after the custom.css:

<h:panelGroup rendered="#{navigationHelper.subThemeDiscriminatorValue != null and navigationHelper.subThemeDiscriminatorValue != '-'}">
    <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/themes/#{navigationHelper.theme}/css/dist/#{navigationHelper.subThemeDiscriminatorValue}.min.css" />

Each sub-theme has its own CSS file that contains its own CSS definitions for that sub-theme. The order in which they are included in the template.html file can be used to overwrite any value of the global viewer.css file or the theme specific custom.min.css file with subtheme-specific values in this subtheme-specific file.

Last updated