Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

New Base Theme and Restructured dri2xhtml for 1.7.0

@mire contribution of new theme to support easier development and branding.Provides the following:

  1. A Restructured dri2xhtml base templates for easing locating specific XSLT templates
  2. A Basic Theme based on the above restructured library that contains the templates that need customization most often in the UI.

dri2xhtml-alt

See committed source for dri2xhtml-alt here: http://scm.dspace.org/svn/repo/dspace/trunk/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/dri2xhtml-alt/

Configuration and Installation

The alternative basic templates has been committed, and is currently dubbed "dri2xhtml-alt".
Any of the existing themes can be updated to reference this new set of templates by replacing in your theme.xsl:

<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:xlink="http://www.w3.org/TR/xlink/"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:dim="http://www.dspace.org/xmlns/dspace/dim"
	xmlns:xhtml="http://www.w3.org/1999/xhtml"
	xmlns:mods="http://www.loc.gov/mods/v3"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns="http://www.w3.org/1999/xhtml"
	exclude-result-prefixes="i18n dri mets xlink xsl dim xhtml mods dc">

    <!--
        comment out original dri2xhtml
        <xsl:import href="../dri2xhtml.xsl"/>
        and enable dri2xhtml-alt
    -->

    <xsl:import href="../dri2xhtml-alt/dri2xhtml.xsl"/>

    <xsl:output indent="yes"/>

Because the contents of dri2xhtml-alt is identical to the current dri2xhtml.xsl and its derivatives, updating any of the existing themes to reference the new dri2xhtml-alt should not impose any changes in the rendering of the pages.

Features

  • No changes to existing templates found in legacy dri2xhtml
  • Drops inclusion of Handlers other than DIM and Default
  • Templates divided out into files so they can be more easily located, divided by Aspect, Page and Functionality
/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes/dri2xhtml-alt/

├── aspect
│   ├── administrative
│   │   └── harvesting.xsl
│   ├── artifactbrowser
│   │   ├── COinS.xsl
│   │   ├── ORE.xsl
│   │   ├── artifactbrowser.xsl
│   │   ├── collection-list.xsl
│   │   ├── collection-view.xsl
│   │   ├── common.xsl
│   │   ├── community-list.xsl
│   │   ├── community-view.xsl
│   │   ├── item-list.xsl
│   │   └── item-view.xsl
│   └── general
│       └── choice-authority-control.xsl
├── core
│   ├── attribute-handlers.xsl
│   ├── elements.xsl
│   ├── forms.xsl
│   ├── global-variables.xsl
│   ├── navigation.xsl
│   ├── page-structure.xsl
│   └── utils.xsl
└── dri2xhtml.xsl

Basic Theme

Features

  • Makes use of the new dri2xhtml-alt, and everything which is replaced in the theme is included using the exact same hierarchy for a good overview
  • The simple item display has been redesigned give a better overview of the available metadata. The style and position of the fields were changed to better suit their contents.
  • There are two built in ways to render item lists: One more suited for a repository containing scientific papers, and one for a repository that has more of a focus on the files attached to the item instead of the item metadata. You can switch between them using the 'xmlui.theme.mirage.item-list.emphasis' dspace.cfg property. Possible values are 'metadata' and 'file', 'metadata' is the default.
  • The user agent detection in the sitemap is no longer used to have different stylesheets for different browsers. Because user agent sniffing isn't very reliable, and spreading css rules about the same element over different files for different browsers can make debugging harder. Instead, for IE conditional comments give the body tag a class corresponding to the version of IE, and modernizr is used to detect which css features are available. This way you can target all browsers that support a certain feature using css classes, and rules affecting the same element can be put together in the same place for all browsers.
  • CSS files are now split up according to function instead of browser: There is a separate file for the reset css, one containing a few base styles, one containing helper classes. These files rarely need to be changed, and this leaves style.css containing only rules unique to the theme. There are also separate files for print css and other media.
  • We've also included concatenation and minification for css and js files:
    • This is disabled by default, and will need to be enabled in the configuration using the properties 'xmlui.theme.enableConcatenation' and 'xmlui.theme.enableMinification'
    • The IncludePageMeta has been extended to generate URL's to the concatenated version of all css files using the same media tag (if enabled in config)
    • The ConcatenationReader has been created to return concatenated and minified versions of the css and js files
    • This is built to use the list of included css files, last modification timestamps, ... for caching purposes.
    • In order to enable this for any of the existing themes, the theme sitemap must be altered as well.
    • Note that when minification is enabled, all comments will be removed. This could be a problem for comments containing copyright notices, so for files with those comments you should disable minification by adding '?nominify' after the url e.g. 
 <map:parameter name="javascript" value="lib/js/jquery-ui-1.8.5.custom.min.js?nominify"/>
  • Javascript references were moved to bottom of page. This way pages will seem to load faster, because the structure of the page will already be loaded while the js files are being retrieved.
  • jQuery and jQueryUI are included by default. To avoid conflicts the authority control javascript has been rewritten to use jQuery instead of Prototype and Script.aculo.us.

Screenshots











  • No labels