6.4.2 Settings in the Goobi viewer

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

solr_indexerconfig.xml
<init>
<namespaces>
<list>
<intranda>https://intranda.com/MODS/</intranda>
</list>
</namespaces>
<init>
[...]
<MD2_VIEWERSUBTHEME>
<list>
<item>
<xpath>mets:xmlData/mods:mods/mods:extension/intranda:viewersubtheme</xpath>
<addToDefault>false</addToDefault>
<addUntokenizedVersion>false</addUntokenizedVersion>
</item>
</list>
</MD2_VIEWERSUBTHEME>

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

config_viewer.xml
<viewer>
<theme subTheme="true"
mainTheme="THEMENAME"
discriminatorField="MD2_VIEWERSUBTHEME"
autoSwitch="true"
addFilterQuery="false"
filterQueryVisible="false"></theme>
</viewer>

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

template.html
<!-- SUBTHEME 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" />
</h:panelGroup>

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.