Skip to content

About

Generative tooltips by glossary

Resources

Stars

4 stars

Watchers

114 watching

Forks

Repository files navigation

collective.glossary

PyPI version Python versions Plone versions CI License

Plone backend add-on to define a glossary and provide tooltips on matching text.

Features

  • The terms are defined as title / definition pairs.
  • The term can have variants.
  • The definiton is richtext formated.
  • The tooltip can be disabled in glossary control panel.
  • Tooltips can be restricted to a selection of content types.
  • REST API service @glossary_terms to fetch the terms of a glossary.

@rohberg/volto-slate-glossary is the corresponding Volto add-on.

Caching

Volto fetches @tooltip_terms on every page view, while the terms rarely change. Both REST API services, @tooltip_terms and @glossary_terms, therefore use the caching ruleset Glossary terms (collective.glossary.terms) of plone.app.caching.

When plone.app.caching is installed, installing or upgrading collective.glossary maps this ruleset to Terse caching, with these settings:

Setting Value Header
Maximum age 10 seconds max-age=10
Shared maximum age 300 seconds s-maxage=300
Only cache for anonymous users Yes max-age=0, must-revalidate, private for logged-in users
Vary Accept, Authorization, Origin Vary: Accept, Authorization, Origin for anonymous visitors

A caching proxy such as Varnish then keeps the answers for anonymous visitors for up to 5 minutes. An answer for a logged-in user may contain unpublished terms, so caching proxies do not store it, and the browser fetches it again each time. Origin in Vary keeps the answers for the different origins of a CORS policy apart. Change the settings in Site Setup > Caching, on the Caching operations tab, for the Glossary terms ruleset.

The upgrade to profile version 7 sets Only cache for anonymous users and an empty Vary for the operation the Glossary terms ruleset is mapped to. It keeps the operation, the maximum ages, and a Vary you entered.

Purging

Installing or upgrading collective.glossary with plone.app.caching installed adds Term to the content types to purge. When plone.app.caching purges a caching proxy, changing, publishing, retracting, or deleting a term purges @tooltip_terms and @glossary_terms of its glossary and of every folder above it up to the site, with and without /++api++. Moving or renaming a term, its glossary, or a folder above it purges these answers at the old and at the new place. Without purging, a changed term reaches visitors within 5 minutes.

These changes are not purged and reach visitors within 5 minutes:

  • answers requested with a query string;
  • a new or copied term, until a workflow transition follows; with the usual workflows a term becomes visible by publishing it, which purges;
  • changes in the glossary control panel, which @glossary_terms reports.

A login that sends no Authorization header, such as the cookie login of Classic UI, does not take part in Vary. A caching proxy may answer such a user with the version for anonymous visitors, which lacks unpublished terms but reveals nothing.

Installed plone.app.caching after collective.glossary? Apply the collective.glossary:caching profile in the ZMI, under portal_setup > Import, or map the Glossary terms ruleset yourself in the caching control panel. Without a mapping, the services send no Cache-Control header, and caching proxies do not cache them.

Screenshots

Create a Glossary

Create a Glossary.

Use it!

Use it!

Control Panel

Configure glossary settings in the control panel.

Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository, then change your working directory.

    git clone git@github.com:collective/collective.glossary.git
    cd collective.glossary
  2. Install this code base.

    make install

License

The project is licensed under GPLv2.

Acknowledgements

Generated using Cookieplone (0.9.7) and cookieplone-templates (c7497ac) on 2025-06-25 15:56:13.999992.

About

Generative tooltips by glossary

Resources

Stars

4 stars

Watchers

114 watching

Forks

Releases

Used by

Contributors

Languages