|
Cookbook /
FAQToggleListSummary: Adding toggle buttons to a definition list
Version: 2006-10-28
Prerequisites: pmwiki 2.1
Status: stable
Maintainer: DaveG
Categories: Layout
Download: dltoggle.zipΔ
Questions answered by this recipeHow can I create a FAQ list where the answers are hidden by default but can be individually shown by clicking a button or the question? Descriptiondltoggle.zipΔ adds toggle buttons to a definition list (for instance a FAQ list).
dltoggle.php integrates TJK_ToggleDL by Thierry Koblentz - www.TJKDesign.com (see demo) into pmwiki, to create FAQ toggle lists using Install dltoggle.php into the Farm/cookbook folder, all other files of dltoggle.zipΔ into the farm/pub/dltoggle/ folder. Add to config.php: include_once("$FarmD/cookbook/dltoggle.php");
Usage:(:dltoggle:) Definition list(s): : term : definition : term : definition Subheaders etc. : term : definition : term : definition etc. (:dltoggleend:) Add (above the list) optional buttons to 'Show All' and 'Close All' definitions with (:input submit id=DLToggleOn value='Open All' class=inputbutton:) and
(:input submit id=DLToggleOff value='Close All' class=inputbutton:)
For browsers with no javascript support the buttons will not show, and all definitions will be visible. Notes
Between these two markups any definition list element is treated with a toggle button. This makes it possible for instance to have several lists, divided by subheaders, like on the cookbook page. Javascript and css code gets loaded only when (:dltoggleend:) markup is present. Edit the css file to load different plus and minus button images etc. Release Notes
Comments
See AlsoContributors |