Reputation: 2689
Say I have a base XMLUI theme /Mirage1
, and another theme /Mirage1-green
, and /Mirage1-red
. How can I make it so that Mirage1-green
and Mirage1-red
don't have to have copies of all the XSL code and logic, but instead just have green.xsl, green.js, and green.css, and then the other theme has red.xsl, red.js and red.css?
My goal for doing this is so that I can make bug fixes and other improvements to the base theme Mirage1, and not having to repeat those fixes to the other themes too.
I'm thinking that the solution involves Mirage1-green
theme's sitemap.xmap to import Mirage1-green/xsl/green.xsl, which then imports ../Mirage1/aspect/artifactbrowser/common.xsl
and so on, but links to code, or other guides would be much appreciated.
Upvotes: 1
Views: 644
Reputation: 1063
The following will only work for XMLUI themes that are based on the recently contributed Mirage 2 theme:
The inheritance of the base Mirage 2 theme is implicit and automatic.
An example has been put in place in the DSpace master branch to make this clear:
This folder currently contains a single _style.scss file, overriding the _style.scss in the styles folder from the Mirage 2 source files at:
https://github.com/DSpace/DSpace/tree/master/dspace-xmlui-mirage2/src/main/webapp
Upvotes: 1
Reputation: 3956
We have implemented a similar solution, and we can easily roll out a new custom theme with minimal changes.
We tend to customize a header image and link target, footer text, and a few CSS styles per collection.
Here is an example of what one of our custom collection stylesheets looks like.
<xsl:stylesheet xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
xmlns:dri="http://di.tamu.edu/DRI/1.0/" xmlns:mets="http://www.loc.gov/METS/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
xmlns:mods="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/TR/xlink/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../non-GU-lib.xsl" />
<xsl:output indent="yes" />
<xsl:variable name="header-logo"
select="concat($context-path,'/themes/GU-base-theme/non-GU-lib/ir/images/ir-logo.png')" />
<xsl:variable name="header-logo-link">
http://library.georgetown.edu/ir/home
</xsl:variable>
<xsl:variable name="teaser-image"
select="concat($theme-path,'/images/ir-teaser.jpg')" />
</xsl:stylesheet>
Upvotes: 1