|
Cookbook /
GlossaryPlusSummary: Glossary Plus
Version: 2008-01-03
Prerequisites: pmWiki-2.2.x and domTT
Status: Alpha! Use at your own risk!
Maintainer: Kaptain Kory
Categories: FunctionalExtensions, Links
Questions answered by this recipeHow can I create an integrated glossary for my site? DescriptionThis script creates a cross-linked glossary. Like the DomTT recipe, this one also uses the DomTT Javascript widget for creating tooltips, but terms and definitions are stored on a single page and applied site wide allowing for easier maintenance and greater functionality. InstallationStep 1Download the latest version of DomTT. This Javascript widget is used for creating the tooltips necessary for this recipe to work. Save the DomTT library to your web server where it is accessible by PmWiki. The default location within the wiki directory is "pub/domTT". Step 2Download glossaryplus.phpΔ and save it to your cookbook folder. Step 3Open glossaryplus.php in a text editor and review the default variables. Customize to suit your needs. Step 4Add the following line to your config.php file: include_once("$FarmD/cookbook/glossaryplus.php");
Step 5Add the following code to your CSS file:
a.glossary-link, a:visited.glossary-link, a:hover.glossary-link {
cursor: help;
color: black;
text-decoration: none;
border-bottom: 1px dashed #708090;
}
div.glossary-popup {
border: 1px solid #333333;
background-color: #333333;
}
div.glossary-popup .caption {
font-family: serif;
font-size: 12px;
font-weight: bold;
padding: 1px 2px;
color: #FFFFFF;
}
div.glossary-popup .contents {
font-size: 12px;
font-family: sans-serif;
padding: 3px 2px;
background-color: #F1F1FF;
}
#wikitext dt {
font-weight: bold;
border-top: 1px solid #333333;
}
#wikitext dd {
margin: 0px;
}
Step 6Create a wiki page for your glossary. The default is Main.Glossary. Use definition list formatting for your items (:term:defintion). Step 7Glossary terms that now appear in other wiki pages will show a tooltip with a definition for that term and clicking the term will link back to the glossary. Tips and Tricks
Bugs / Known Issues
DemoThe script is currently active at Snakes of Arkansas. Release Notes
CommentsFor use in a Farm, as per the include given in Step 4, the path to the DomTT javascript libraries must be changed from the local SDV($DomTTPubDir, " SDV($DomTTPubDir, " Des June 22, 2007, at 04:02 PM Bug report - Spurious acronym detection within page htmlProbably just an extension of the first Bug/Issue mentioned above. I found an instance where the recipe picked up internal css page styling, and killed it by adding the glossary formatting around it. The generated page html included this section prior to the activation of GlossaryPlus: <div id='map'></div>
<div class='vspace'></div><div style="
border: 1px solid #aaa;
background-color: #f9f9f9;
After activating GlossaryPlus, it detected the border colour of #aaa; and replaced it with the domTT activation code for :AAA:Anti-Aircraft Artillery, breaking the styling and making it visible on the page as follows: <div id='map'></div>
<div class='vspace'></div><div style="
border: 1px solid #<a class='glossary-link' href='http://www.secretscotland.org.uk/index.php/Main/Glossary#aaa'
onmouseover="domTT_activate(this, event, 'content', '<p>Anti-Aircraft Artillery </p>', 'trail', true, 'styleClass',
'glossary-popup');">aaa</a>;
background-color: #f9f9f9;
In this particular case, the 'fix' was very simple - just replacing the shortcut colour code of #aaa; with the full #aaaaaa; restored the page style, however the potential for similar random matches with acronym letter combinations still exists (and my knowledge of PHP is way below doing anything about it). Des June 24, 2007, at 06:04 AM See AlsoAlso see DomTT and AutomaticLinks. Contributors |