Choose a style: Default Greenstone, Blue, OlivePurple, None

Cascading Style Sheets

A combination of JavaScript and the overriding of GS3 XSL templates in Greenstone 3's global format statement is used by the collection to provide the stylesheet switching. As in some other Documented Example Collections, GLI's Format > Format Features > global can be used to define the additionalHeaderContent template. Doing so overrides the existing additionalHeaderContent template, and appends any specified HTML elements to the HTML header.

In this case, the additionalHeaderContent specifies the custom collection stylesheet currently active and the JavaScript to facilitate the stylesheet switching when a link is clicked. The create-banner XSL template in the global format statement is also overridden to provide links to the multiple stylesheets within the existing GS3 banner section, and invoke the custom JavaScript when any link is clicked.

<xsl:template name="additionalHeaderContent"> 
<xsl:variable name="httpCollection"> 
<xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> 
<link rel="stylesheet" href="{$httpCollection}/style/gs3-style-default-extra.css" type="text/css"  
title="GS3 Style" id="custom-style" charset="UTF-8"/> 
<script src="{$httpCollection}/script/custom-script.js" type="text/javascript"> 

<xsl:template name="create-banner">   
<div class="choose_style"> 
Choose a style: 
<a href="#" onclick="replaceStyle('gs3-style-default-extra');return false;">Default Greenstone</a>, 
<a href="#" onclick="replaceStyle('gs3-style-blue');return false;">Blue</a>, 
<a href="#" onclick="replaceStyle('gs3-style-olive-purple');return false;">OlivePurple</a>,		 
<a href="#" onclick="replaceStyle('');return false;">None</a> 
<div id="gs_banner" class="ui-widget-header ui-corner-bottom">	     
<div id="titlesearchcontainer"> 
<xsl:call-template name="page-title-area"/>	 
<xsl:call-template name="quick-search-area"/> 
<div style="clear:both;"><xsl:text> </xsl:text></div>	 
<xsl:call-template name="browsing-tabs"/>	 

If you want to download any of these stylesheets for your own collections, here are links to them:

Using a downloaded stylesheet