Topic: Glossary on website

Hi all,

To explain some subject-specific words and expressions on my website I'm looking for a glossery-script. I like the feature that gives the explanation in a (editable) pop-over. Also it would be very handy if the script can recognize the glossery-items on the webpages in the backend so no word is missing for encoding.

Does anyone knows if such a plugin/script exist for easy implemantation in the wolf-cms? I've done some searching on the internet but all I got is dead links or commercial scripts. And to be in line with Wolf I prefer an open-source script. 

Maybe it turns in a plugin for Wolf?

Kind regards,

Galileo

Thumbs up

Re: Glossary on website

Just to get the idea what a glossay script does I like to see a example.

Re: Glossary on website

Hello Fortron,

o.k., I hope my English is sufficient to explain clearly what I mean.

For instance let's thinking of a website about some popular science. There are many words on many pages (articles) who aren't clear for the average reader. I do not want the reader to go to another page everytime for every unknow word. Every time he/she hovers such a word, a little textbox (tooltip?) will appear with a short explanation.

Where are those explanations come from: each word (item) and related explanation is defined and written by the administrator in a separate page or database, called glossary. Both, word and explanation, are linked to the words mentioned in the articles. The tooltip of the words contains the explanation.

To mark the words which have an explanation they have a different color. Of course one can put the html-markup by hand for every glossary-word. But when a word is mentioned 10 times on 4 different pages it will be nice if those words are recognizabled by the script and automaticly become their explanation and html-markup.

An additional feature would be that the complete glossary is visible on one or more webpages.

I hope this make things clear?

Thumbs up

Re: Glossary on website

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)

Thumbs up

Re: Glossary on website

Hello Andrewmman, thank you for the reply and taking the first step! Unfortunately I do not have the knowledge for php-coding... maybe someone does see the advantage of such a plugin and does have time and skills for taking step 2?

Many thanks in advance but when it doesn't come to a plugin there's no one overboard, it's not a must for me though in my vision it seems a handy future to have.

kind regards, Galileo

Thumbs up