We recently revamped the Law Society of Newfound and Labrador Library (LSNLL) catalogue interface. One of the features we added was a method to open and close the Table of Contents on the search results page.

The LSNLL catalogue interface, which uses Inmagic WebPublisher PRO, has always just had one form – a brief one - which pretty much consists of just a bibliographic citation, a call number and “see also” subject links. The previous brief form also had the Table of Contents displayed if that information was in the record. If there were Tables of Contents in several results records, this greatly added to the length of the brief list.

Rather than having a full display just to show the additional Table of Contents information and to also minimize the length of the brief display, we came up with a scripted solution that opens and closes the Table of Contents as needed. This could also be used to expand and contract full text in a textbase record or just text on a static page.

Here’s a short video illustrating how it works:

Unable to display content. Adobe Flash is required.

The details of the method are as follows:

Download a copy of jquery.js from http://jquery.com and insert it in a scripts folder under the layout folder (referenced from head tag in the form – see below).

In the DB/Text web form:

<div class="ShowHide"><a href="#">Table of Contents</a></div>

<div class="expandDiv"><div>TableofContents</div></div>

[TableofContents is the field, the rest is added beginning and ending text]