greenstone.org
greenstone wiki
greenstone trac
planet greenstone

Customizing your Greenstone library

From GreenstoneWiki

Contents

How do I change the logo on the front page of my library ("greenstone digital library software")?

You can change the logo that appears at the top of the front page of your library by editing the home.dm file in your Greenstone "macros" folder and replacing all instances of "gsdlhead.gif" with the name of your logo image file.

Where can I get more information about customizing my Greenstone library?

Try this document. There is also a basic introduction to using CSS in Greenstone in this document.

How can I add a new page to my Greenstone library?

Adding a new static page to Greenstone is relatively simple and involves only customizations to macro files (found in gsdl/macros). (Adding a dynamic page is more difficult and involves adding a new action to the C++ receptionist.)

Lets look at the example of adding a new static page called mypage.

Link to the new page from the home page
Edit the _content_ macro in home.dm, adding the link where you want it. The link will look something like

<a href="_httppagex_(mypage)">My Page</a>.

Create the macro file
Create a new file called mypage.dm in gsdl/macros.
Tell the library about the new file
Edit gsdl/etc/main.cfg. Add mypage.dm to the macrofiles list

mypage.dm will contain all the content on the page. A basic mypage.dm might look something like the following.

package mypage

_pagetitle_ {My New page}

_content_{
<h2>My New Page</h2>
This is the content of the page.
}

The URL for the new page can be specified internally as _httppagex_(mypage): this maps to your library address with cgi arguments a=p&p=mypage.

If this is not a page that belongs to a collection, you should modify the 'home help prefs' buttons. You may like to add the following to your mypage.dm.

_javalinks_ {_imagehome_ _imagehelp_ _imagepref_ }

_imagehelp_{_gsimage_(_home:httppagehomehelp_,_httpiconchelpof_,_httpiconchelpon_,help,_textimagehelp_)}

_imagepref_ {_gsimage_(_home:httppagehomepref_,_httpiconcprefof_,_httpiconcprefon_,pref,_textimagepref_)}

This will give you the standard home button, and the help and preferences buttons that link to the same pages as those on the home page. Help and preferences are different depending on whether you are in a collection or not.

If you are using the Windows local library server you probably need to restart it for the changes to take effect.

What do the cgi arguments used by library stand for?

CGI arguments encode the parameters of each page, for instance, what kind of page to display, what query to carry out etc. This page gives a list of the most common arguments and what they are used for.

How do I change the default settings for the cgi arguments?

You can set the default value of any cgi argument in the Greenstone\etc\main.cfg file. Add a line like

cgiarg shortname=a argdefault=p

This will set the default value of argument 'a' to 'p'. To find out which argument you need to change, see this page for a list of common arguments, or look at the page source of the page in the browser.

How do I get rid of the external link page?

Clicking on a link to an external resource from a Greenstone document takes the user to an intermediate page that says something like the following:

"External Link
The link you have selected is external to any of your currently selected
collections. If you still wish to view this link and your browser has access to
the Web, you can go forward to this page; otherwise use your browsers "back"
button to return to the previous document.”

To get rid of this intermediate page, add the following to greenstone/etc/main.cfg

cgiarg shortname=el argdefault=direct