Files:
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/sitemap.xmap (The theme's SiteMap configuration)
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/lib/style.css (CSS stylesheet)
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/lib/style-ie6.css (CSS stylesheet for IE)
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/template.xsl (XSLT overrides for Theme)
Important Directories:
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/ (Directory where all your custom themes should be placed)
- dspace-src/dspace/dspace-version-build.dir/webapps/xmlui/themes/ (Directory where all out-of-the-box DSpace themes will be pulled down to after building DSpace for the first time.)
Instructions:
- First determine a directory name for your new theme inside the dspace-src/dspace/modules/xmlui/src/main/webapp
directory; this name will be referenced as theme-dir in these instructions.
/themes/
- Instead of starting your new theme completely from scratch, make a new copy of the standard theme template in a new directory, theme-dir.
- First, build DSpace (
) if you haven't already
mvn package
- dspace-src
cd
/dspace/target/dspace-[version]-build.dir/webapps/xmlui/themes/
- theme-dir
cp -R template
- First, build DSpace (
- Next customize the theme's sitemap by specifying the theme's directory and name. Open, dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/sitemap.xmap, and edit the global variables shown below:
<map:component-configurations>
<global-variables>
- theme-dir
<theme-path>
</theme-path>
- the name of your theme
<theme-name>
</theme-name>
</global-variables>
</map:component-configurations>
- Next customize the theme's CSS stylesheets, by default there are two style sheets used - a base version for all browsers and then a supplemental version just for Internet explorer.
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/lib/style.css
- dspace-src/dspace/modules/xmlui/src/main/webapp/themes/theme-dir/lib/style-ie6.css
- Perform the steps in Install+a+theme
- Perform the steps in Rebuild+DSpace
Hints on Customizing XSLT in a theme:
These hints assume that you've started your theme based on a copy of the out-of-the-box
template
theme, along with the template.xsl that comes with that theme.
- Hint #1: Add
or
?XML
on the end of the URL to view the underlying XML for a given page.&XML
- Hint #2: Locate the appropriate
to override in the
<xsl:template>
theme that comes with DSpace. Thedri2xhtml
theme includes 5 main XSLT files. The three with (default) next to them are the only ones used by default in DSpace.dri2xhtml
- (default) = matches Item/Collection/Community METS files which contain DIM (DSpace Intermediate Metadata) format. (i.e. controls the display of all default metadata)
DIM-Handler.xsl
- (default) = matches the
General-Handler.xsl
section of Item-level METS files (i.e. controls display of individual files/bitstreams)<fileSec>
- = matches Item/Collection/Community METS files which contain MODS metadata. (i.e. controls the display of all MODS metadata)
MODS-Handler.xsl
- = matches Item/Collection/Community METS files which contain Qualified Dublin Core metadata. (i.e. controls the display of all QDC metadata)
QDC-Handler.xsl
- (default) = defines the layout / page structure for all of DSpace
structural.xsl
- Hint #3: There are a total of four metadata display "modes" used in DSpace. The
tags in each of the
<xsl:template>
files are named after these "modes".*-Handler.xsl
- SummaryList = Summarized List of Objects
- E.g. Community/Collection listing pages, item browsing/searching pages
- SummaryView = Summarized View of a single Object
- E.g. Item homepage (by default includes summarized metadata only)
- DetailList = Detailed List of Objects
- (Rarely used) E.g. The "item appears in the following collections" section on an Item's page is a DetailList of Collections, as it includes both collection names and brief descriptions
- DetailView = Detailed View of a single Object
- E.g. Item "full record" page, Collection/Community homepages
- SummaryList = Summarized List of Objects