You could build a plugin for that.
In the backend you manage (add,edit, delete) the terms and their description. This should be fairly simple.
And for the frontend you could, for example, wrap each term in a tag with a specific class, i.e:
... ...<a href="path/to/glossary#term" class="glossary_term">term</a>. ....
and use ajax to load the definition on document load and build the tooltip. Using jquery, for example:
$(document).ready(function() {
// Load glossary terms definitions
$('a.glossary_term').each(function() {
// proccess the tag attributes and do the ajax call
// to load and attach the definition
// and build the tooltip also
});
// You should bind 'hover' and 'click' events to show the tooltip
});
For that to work, you must add a custom route (Dispatcher) that receives the term passed by the javascript call and returns its definition.
Example:
Dispatcher::addRoute(array(
'/glossary/search/:any' => 'plugin/glossary/search/$1'
));
The first is the url you use to retrieve the description and also the one used in your ajax function, the second is the callback mapped to a specific method(action) of your plugin, which is the one responsible of returning the description.
To help you start, look at Martijn's Messages plugin. Although it's used only in the backend, it should be of great help.
Also, for the backend part of your plugin, you should look at the Snippet Model and SnippetController it's very similar to what you want for the admin interface, except for the index (you don't need reordering).
Hope it helps.
Last edited by andrewmman (2012-01-28 15:36)