Greenstone tutorial exercise

Back to wiki
Back to index
Sample files:
Devised for Greenstone version: 3.05
Modified for Greenstone version: 3.11

Customization: Themes

This exercise looks at changing the appearance of your entire Greenstone Library using Themes created with jQuery ThemeRoller. First, we will look at how to use premade themes. Then, we will make a custom theme using ThemeRoller.

Using Greenstone Visual Themes

  1. Enter your Greenstone Library. ( Go to Start → All Programs → Greenstone-3.11 → Greenstone3 Server and click Enter Library.)

  1. In order to make changes to the library's theme, you must be logged in as an administrator. Click Login in the top right-hand corner. The default login is:

    Username: admin
    Password: admin

    Click Login. It is advisable to change the default password, if you haven't already. To do this, click the admin button in the top right-hand corner, and select Account Settings. Click Change Password. Enter the Old password (admin); then enter a new password in the New password and Retype password text boxes. Click Submit and the password will be changed. Click on the My Greenstone Library link at the top left to go back to the home page. There you'll find a link to the Administration Page further down (you may need to scroll down if there are many collections). Click on it and you'll be taken to the Administration Page, where you can view a list of the current users.

  1. Go to Preferences. Now that we are signed in as an administrator, we can see the Visual theme: option, where we can quickly change the theme of our collections. These themes were created using JQuery UI’s ThemeRoller ( The first three options (Greenstone Default and Greenstone Custom 1 and 2) are included as part of the Greenstone 3 installation. The remaining themes are retrieved from the web via the jQuery UI API.

    Select Theme: Greenstone Custom 2 from the drop-down menu, and click Set preferences. Now, all of the collections in your Greenstone library should have the Greenstone Custom 2 theme.

    Return to the library homepage (click My Greenstone Library in the upper left-hand corner) and explore several of your collections. They should all display the new theme.

Creating a custom theme using ThemeRoller (advanced)

  1. Go to the jQuery UI ThemeRoller webpage ( The Roll Your Own menu of the ThemeRoller bar on the left can be used to design a custom theme. As changes are made in this menu, the corresponding items on the right reflect these changes. The most important sections for Greenstone customization are:

    SectionHTML classGreenstone 3 usage
    Header/Toolbarui-widget-headerThis sets the appearance of the large, main banner and the footer
    Contentui-widget-contentSets the appearance for the main area of the page, where the content (e.g. a list of documents) is displayed
    Clickable: default stateui-state-defaultSets the appearance for the small bar along the top, most buttons (Login, Help, Preferences, Test Search, Form Search, Advanced Search), and all unselected browse tabs
    Clickable: hover stateui-state-hoverThis sets the appearance for the Login, Help, and Preferences buttons and browse tabs when the mouse hovers over them
    Clickable: active stateui-state-activeThis sets the appearance of the selected browse tab

    ThemeRoller will not affect some aspects of your Greenstone library's appearance, e.g. the actual design layout, the background color, the font, the search button.

  1. Change the Theme to the following values:

    Header/ToolbarBackground color#a23336
    ContentBackground color#000000
    Clickable: default stateBackground color#7e7676
    Clickable: hover stateBackground Color#303030
    Clickable: active stateBackground Color#000000

  1. Click the Download theme button. Select "1.13.2 (Stable, for jQuery1.8+)". Under Components uncheck Toggle All, which will uncheck all of the boxes. Under UI Core check jQuery 1.8+ Support and Keycode, and under Widgets check Datepicker. At the bottom of the page, under Theme, Custom Theme should be selected. (If there's an option to provide a Theme Folder Name, enter TutorialTheme.) Leave CSS Scope blank. Click Download. In the pop-up window, select Save File and click OK to download the zip file.

    If you're unable to download the theme you've created, then we have prepared a zip file in advance containing the same ThemeRoller theme: sample_files → downloads → After extracting, in the following instructions, work with the folder "TutorialTheme" inside any TutorialTheme2019 folder.

  1. Go to the folder where the zip file was downloaded, and unzip the folder. On Windows, unzip as follows: right-click and select Extract All... Remove the folder name "jquery-ui-1.11.4.custom" from the end of the suggested zip extraction path. (For example, if it suggests C:\Users\me\Downloads\jquery-ui-1.11.4.custom, then change it to C:\Users\me\Downloads\.) Then click Extract.

    The extracted folder will be called jquery-ui-1.11.1.custom, or something similar. Rename it to TutorialTheme. It should contain css files, an index.html file, a couple of js files and 2 subfolders (called images and external). We largely only need the folder's structure, the css files (particularly jquery-ui.theme.min.css) and the images subfolder, but it's easiest just to copy the entire folder into Greenstone3 → web → interfaces → default → style → themes.

  1. Go to Greenstone3 → web → interfaces → default → transform → pages and open pref.xsl in a text editor. Find the following section and add in the highlighted text, which can be copied from gs3-theme.tweak.txt). Take note of the initial comma.

    <xsl:text disable-output-escaping="yes">
    imgpath: "interfaces/" + gs.xsltParams.interface_name + "/style/images/",
    additionalThemes: [
    icon:"theme_90_greenstone.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/main/jquery-ui-1.8.16.custom.css"},
    {title:"Greenstone Custom 1", name:"custom-theme1", icon:"theme_90_start_menu.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_1/jquery-ui-1.8.16.custom.css"},
    {title:"Greenstone Custom 2", name:"custom-theme2", icon:"theme_90_mint_choco.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_2/jquery-ui-1.8.16.custom.css"},
    {title:"Greenstone Custom 3", name:"custom-theme3", icon:"theme_90_trontastic.png", url:"interfaces/" + gs.xsltParams.interface_name + "
    {title:"Tutorial Theme", name:"TutorialTheme", icon:"TutorialTheme.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/TutorialTheme/jquery-ui.theme.min.css"}


    Save and close pref.xsl.

  1. Return to the Library homepage. If not still logged in, login again. Go to the Preferences page and click on the drop-down menu for Visual theme:. (If the Visual theme: option has disappeared, ensure that you copied the highlighted section in its entirety into the correct place in pref.xsl, and check especially that you did not miss the initial comma.) The fifth item in the list should now be "Tutorial Theme". It will not have a calendar icon like the other themes, because the image referenced in the above statement - TutorialTheme.png - does not exist. We'll create an icon to match the theme below. For now, select Tutorial Theme, and click Set preferences. All of your Greenstone collections will be in this new, custom theme.

The Visual theme: drop-down menu in Preferences includes an image for each theme, along with the theme title. If no image is available, only the title is displayed. If you would like to include an image for your custom theme similar to those visible for the other theme options, follow the instructions below.

  1. Return to the TutorialTheme folder (in Greenstone3 → web → interfaces → default → style → themes). Open index.html in a web browser. Scroll down so that the Datepicker calendar is completely visible on your screen. Take a screenshot: either by using your browser's screenshot feature, first selecting the outline of the Datepicker image, or else use your PC's ability to take the screen shot. (On Windows, you can do this by pressing the print screen - PrtScn - button.)

  1. Open a picture editor (like Paint) and Paste. Select and crop the image around the calendar under Datepicker. Resize the image to 90px by 80 px. (In Paint, click Resize. Under Resize, choose Pixels. Unselect Maintain aspect ratio. Still under Resize - not the Skew section - change Horizontal to 90 and Vertical to 80 and click <OK>.) Save the image in Greenstone3 → web → interfaces → default → style → images as TutorialTheme.png.

  1. Return to the Preferences page, and the Tutorial Theme in the Visual theme: drop-down menu will now have a corresponding calendar icon.

Copyright © 2005-2019 by the New Zealand Digital Library Project at the University of Waikato, New Zealand
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License.”