PTVPopups
Questions answered by this recipe
Can I create a popup for words on my pages, like against a glossary of terms for example?
Description
Create CSS popups over words on a page based on PTVs
Installation
This recipe depends upon MarkupToUnstyled.
Download ptvpopups.phpΔ and add it to your config.php:
include_once("cookbook/markuptounstyled.php"); include_once("cookbook/ptvpopups.php");
Configuration
Create a page with PTVs on it, where the PTV is the name or phrase you want to get a hover popup on, and the value is what the popup should say. For example PmWiki/Glossary.
Because a PTV must be essentially be a "word", in order to do phrases, you merely create the name of your PTV using double-underscores. Thus creating Local__configuration__file
if you want to match that phrase. If enabled (see below) on the page of PTVs itself, it will substitute a space for the double underscores.
If you don't want to enable the popups on the page of PTVs itself, you can always enable the following markup for that page instead (implementation details not provided here):
Markup('__', '>inline', '/__/', ' ');
Usage
Simply reference the page of PTVs you want to activate on a page.
{(ptvpopups PmWiki/Glossary)}
Notes
Change log / Release notes
- 2017-07-24 Change >restore to <restore. "Keep" needs to mean "keep". Fixes problem of markup rewriting edit text area on edit when Preview is selected.
- 2017-07-26 Optimizations suggested by Petko. Thanks Petko!
See also
Contributors
- Petko (optimization)
Comments
See discussion at PTVPopups-Talk
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.