DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:hidden

This is an old revision of the document!


hidden Plugin

Compatible with DokuWiki

2009-12-25, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, ponder stibbons, Hrun, Detritus, Frusterick Manners, 2016-06-26, 2017-02-19

plugin Let use portion of text that can be hidden/displayed, to ease reading

Last updated on
2017-07-18
Provides
Syntax
Repository
Source
Conflicts with
infomail, tabinclude

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to folded, hide, hidetext, inline_folding, inline_folding2, outliner, stepbystep, toggle, togglewrap

Tagged with collapsible, hide

Needed for hiddenswitch

If you use a version of Dokuwiki older than Angua, please use this older version of the plugin.

Description

If you ever wonder “should I add this detail since it may be very interesting to some readers, or shouldn't I since it would complicate a first reading?”, then you may be interested in this plugin. Indeed, you'll just have to write

<hidden click here if you want to know more>Since you want to know more, here is an explanation with more details […]</hidden>

and the complicated explanation won't clutter up the page, but will still be readable.

Here is a quick example:

To avoid annoying readers we could have:

But an interested reader may click and get:

How to use it

The simplest way is:

<hidden>Hidden text</hidden>

This will display the default text “Click to display ⇲” when the text is hidden, and “Click to hide ⇱” when it's visible.

Some options may be added inside the opening <hidden> tag:

Option Effect Example
any textuse this text instead of the defaults “Click to display” and “Click to hide” <hidden click me!>hidden text</hidden>
onHidden=“any text”Display this text when the section is hiddensee below
onVisible=“any text”Display this text when the section is unfolded<hidden onHidden=“Click to read more” onVisible=“Click to see less”>Hidden text</hidden>
onExportPdf=“any text”Display this text when the page is dw2pdf exported in pdf (defaults to the onVisible text)<hidden onExportPdf=“you're reading a pdf, you can't click me”>hidden text</hidden>
initialState=“visible”The block will initially be expanded. Readers may still click to hide it
-noprintthe text “click to display” won't appear on the printed copy
-edit=“any text”Add an “edit” button below the hidden section.The text will appear when one let his mouse on the button
-editSame as above, but a default text is used

Please note that Dokuwiki formatting syntax may be used with options like “onHidden”.

Hidden Switch

It's possible to add a button that will hide/display every hidden blocks at once using:

<hiddenSwitch>

or

<hiddenSwitch Here comes my custom text>

Therefore, to see it in action, you could create such a page: <file> <hidden>My first hidden block</hidden> <hidden>My second hidden block</hidden>

<hiddenSwitch>

Note: this feature used to be provided by a separate plugin. However, since “hidden v2015-08-12”, they have been merged

Download and Installation

You may download this archive and unpack it in the /lib/plugins directory of your wiki.

You may also use the plugin manager, using this URL: https://github.com/gturri/hidden/zipball/master

Some (important) points

  • If the reader disabled JavaScript, this plugin won't work. More precisely, the full text will be displayed at once. Anyway, it shouldn't be a problem since quite everyone enables JavaScript.
  • If you just installed this plugin and if it doesn't seem to work, try to empty the cache of your browser and the cache of dokuwiki.
  • To use an image in the header, you should use <hidden click here {{image.gif?nolinking}}> (see images for more details).
  • You should avoid to use header inside a hidden section, because there is currently a bug with this case
  • If, after refreshing the cache, the hidden plugin still doesn't work and shows three lines containing the 'click here' text, change the template and revert back to what it was. In my case this solved it.
  • The default texts (“Click to display” and “Click to hide”) can be changed through Dokuwiki admin page, even though the default values for those settings might look weird.

Reporting a bug

Please use the bugtracker to report bugs, rather than using this page.

Some advantages:

  • It's possible to have an actual conversation without overburdening this page
  • It's easier to retrieve information on closed bugs

Since this plugin relies on javascript, if any other plugin (or a non-default template) break the javascript, then this “hidden plugin” will give the feeling it doesn't work.

Consequently, before submitting a bug, please try to

  • Deactivate all your other plugins
  • Switch to the default template
  • Empty the cache of Dokuwiki and the cache of your browser
  • Check if it still doesn't work.
    • If it's the case, please report it on the bugtracker
    • Otherwise it means that an other plugin (or template) is broken or incompatible. You could reactivate them one by one to find the actual guilty one.

Latest changes

plugin/hidden.1500403557.txt.gz · Last modified: 2017-07-18 20:45 by 37.169.237.124

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki