Add a lexicon glossary
A Scratchpad lexicon/glossary is a taxonomy that is displayed differently to other taxonomies and links to terms in certain text fields (like Taxon Descriptions) in a Scratchpad.
The main glossary page has an optional description (either images, text or both) with a horizontal list of numbers and letters for glossary terms beginning with that letter. Clicking on one of these numbers/letters will take you to a list of terms.
By adding parent terms a glossary can be made hierarchical and this hierarchy can be shown in a side menu. However a hierarchical glossary interferes with the alphabetical sorting on the general glossary page, because only the child terms for one parent term are sorted. If the glossary page is set so that one page is shown for each letter, terms starting with this letter will appear on the correct page, but within this page they will show in hierarchical order, not alphabetical order.
Create a vocabulary and add terms
To create a lexicon/glossary you need to first create a new taxonomy
- From the Admin menu go to Structure then click Taxonomy
- Click on the Add vocabulary link
- Enter the vocabulary name, e.g. “Glossary” and optionally a description
- Select “Not a biological classification”
- Click Save
Having created a vocabulary you now need to add the list of terms. This can be done by importing your own file (see Import your own classification). Alternatively you can add terms one by one by clicking on Add terms when you are on the Taxonomy admin page or Edit terms. Add three example terms now. You need to add a NAME and a DESCRIPTION for each term.
Enabling and configuring the lexicon module
From the Admin menu go to Structure > Tools
In the Other section turn the lexicon On
At the top of the Tools page you get a notice that the Lexicon module has been installed and a link to configure it. This configuration link is now also available in the section where you activated the module as well as under Configuration in the Admin menu in case you want to change the configuration later.
Click on the configuration link and select the vocabulary you want to use
Select Show lexicon term descriptions
Click Save configuration
Click on the Path, titles and intros tab to change the URL path to something like “glossary”. If you want a link to the main glossary page to appear in the Main menu you need to create a menu item separately (see Customize menus).
Add an introduction text
Find or create a page that shows one of your glossary terms to check out your new glossary
You can add more fields to the taxonomy you use for the glossary in order show more information for the terms and attach media. To do this:
- Click on Settings for the vocabulary and then on the Manage fields tab where you can add new fields.
You can add synonyms for a term, which will be highlighted, and include a link to the valid term on the glossary page. To add synonyms you have to add a special field to the glossary vocabulary.
- From the Admin menu go to Structure > Taxonomy
- Click on for your glossary and then on the tab.
- Click Add new field with the label “See also:” and field name “synonym”. Select Term reference as field type and “Autocomplete term widget” as form element
- Click Save
- Select your glossary vocabulary
- Click Save again.
- From the Admin menu go to Configuration > Lexicon settings
- Click on the Related terms, synonyms and image tab
- Select the field you just created (“See also:”)
- Click Save
- Enter a synonym term the same way you have added the other glossary terms, but in the synonym field enter the valid term. In the description field enter an explanation like “plural for XY”. If you don't add a description the term will not be highlighted in Scratchpad text but it will appear on the respective glossary page.