This is a cool module which helps newbies understand the jargon which always crops up when specilists talk about a topic. Doctors discuss CBC and EKG and CCs. Web developers keep talking about CSS, P2P, XSLT, etc. This is all intimidating for newbies.

This module does the following:

- let users add/delete/edit glossary nodes. A sample glossary node is:

Title: XSLT
Teaser Extensible Stylesheet Language
Body: A type of XML document which provides instructions for transforming one XML document into another. Often used to transform an XML document into HTML.

- write a Drupal filter which looks for known glossary entries in the user's post and insert a small image next to each glossary entry. The image URL is configurable by Admin. The <title> attribute of the image is the 'teaser'. The image is hyperlinked to the full glossary node. This way, a nuser only has to hover over a term to get a taste of its meaning, but can access the full description when desired.
- a nice enhancement to this filter would be to automatically add glossary nodes to the database when they are encountered. I suggest that any sequence of 3 or more capital letters should be added automatically. These nodes should be added with status=0 so an Admin or other privelleged user can add a teaser and title and then publish the glossary node by setting the status=1.
- a glossary_page() function might provide a nice way to read through all the glossary nodes if a user wanted to do that. Taxonomy provides a helpful mechanism for catagorizing these nodes.

NOTES
- what if the glossary term is already hyperlinked when we discover it i nthe filter? Can we nest a linked image within an <A> tag? Do we rewrite the existing to close and then open after our insertion? Or just ignore the glossary term in this case?

Comments

moshe weitzman’s picture

Technically, the smileys.module is almost an exact replica of this module. You look for known patterns in each post and input a corrosponding graphic wherever you find one.

With smileys as a guide, I think this is a good project for a Drupal novice ... Smileys.module may be found in the Contrib repository or here[1].

[1] http://cvs.drupal.org/viewcvs.cgi/contributions/modules/smileys/?cvsroot...

moshe weitzman’s picture

Priority: Major » Normal

I've implemented a first version of this module. See the Contrib repository. The main difference from the initial description here is that glossary terms are really taxonomy terms, and not full nodes ... Also, taxonomy terms may be displayed with a superscript text link insted of an icon.

From the TODO file:

TODO:

- make an overview page where users can browse the whole glossary.
Depends on some taxonomy navigation functions which don't yet exist.

- when Drupal figures out how to cleanly display taxonomy terms in nodes, consider
not disturbing the users post and instead show related glossary terms at the bottom of the page. This
would make editing a post with glossary terms a bit cleaner. In order
to do this, actually save the matched glossary terms using the taxonomy
API instead of inserting links to them in the body of the post (though
inserting links has that cool hover feature).

- deal with the problem of embedding links within links which happens when
a matched glossary term is already inside of an tag. We currently nest another
within the existing link which is technically invalid HTML (note: this
becomes moot if we do the item above).

- make another filter which discovers candidate glossary terms
(perhaps any sequence of 3 or more capital letters) and save those
in a table where the admin "promote" them to glossary term status and
givethem definitions if they are in fact worthy of glossary status.

- try to match against synonyms in addition to terms.

moshe weitzman’s picture

closing this item since the glossary.module is now in Contrib. Interested folks should go ahead that module and send any improvements to me.