DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:nodisp

This is an old revision of the document!


nodisp Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin Prevents selected text from being sent from server to browser based on acl; or hides display of text in browser, except from admin or manager

Last updated on
2021-07-29
Provides
Syntax
Repository
Source

Installation

Install from the extension manager.

To install manually, refer to Plugins.

Examples/Usage

This plugin has two ways of concealing text from unauthorized users.

  1. In the first case, it conceals text from all viewers except users who are logged in and belong to either the admin or manager group. The text is still on the page, but not displayed. This means it can be viewed using the browser's view source facility.
  2. In the second case, an acl level is set and if the viewer does not have an acl level equal to or greater than the acl setting, the text is completely removed from the page. It is not output from the server to the browser. The same is true if the site allows viewers to view the page source using Dokuwiki's view source action.

Syntax

The syntax for the first case

<nodisp> your text here </nodisp>

<nodisp>
your text here
etc
</nodisp>

The syntax for the second case

<nodisp acl> your text here </nodisp>

<nodisp acl>
your text here
etc
</nodisp>

acl is the numeric representation of the acl level which is required for the marked off text to be output to the browser. In other words the viewer must be logged in and have acl rights for the page in order for the marked up text to be included in the page. So, for example, with <nodisp 8> the viewer must have upload permission or greater for the namespace where the page appears; with <nodisp 2>, the viewer must have edit permission or greater for the page, etc.

It's possible to have several nodisp blocks on a page, each with a different acl level, so that the current user might have access to one section of text and not another. For example, the user might have write permission 1) for a page but not create permission for its namespace. <nodisp 2> would mark off a passage which this user could view, but <nodisp 4> would mark off one which this user does not have access to. A user with create permission for page's namespace 2) would uhave access to both. The ACL levels are described in the acl documentation.

Newline syntax

{nodisp} your text here {/nodisp}

{nodisp}
your text here
etc
{/nodisp}

{nodisp acl} your text here {/nodisp}

{nodisp acl}
your text here
etc
{/nodisp}

The <nodisp. . . > syntax sets off blocks of text. If you place two blocks, one after the other, there will be a paragraph break between the two. The newline syntax treats the enclosed text as a single line unless an extra newline (CR/LF) or the DokuWiki newline markup is inserted. This conforms to the practice of the DokuWiki editor. If you place one newline entry above another, they will continue on the same line unless a newline is inserted. See https://github.com/turnermm/nodisp/issues/3

If you are upgrading from an earlier version of nodisp, which does not support the newline syntax, you will have to remove the file syntax.php from the root directory of the plugin. This is now replaced by a new file called basic.php in the syntax directory.

Development

Change Log

  • 2016-01-16 by Michael Hamann
    • Fix method signature compatibility for PHP 7.0
  • 2013-02-14 by Michael Hamann
    • Cache is automatically disabled now, no need for ~~NOCACHE~~ anymore
    • The plugin uses a <div>-Element now as it had the paragraph type stack anyway which meant that a new paragraph was opened inside the plugin and thus the plugin worked on block level and using a <span>-element produced invalid HTML.
    • Allows more syntax (paragraphs, lists, tables, …) inside the plugin

Known Bugs and Issues

Can you add this warning in the description of your plugin? Thanks. The page source is always visibile clicking the “show pagesource” button. — anto1945 2013/07/22 07:25

This is true for all the plugins which “hide” material. The only way to get true hiding is to use the include plugin. See the forum for this thread: https://forum.dokuwiki.org/post/39559

The above limitations are no longer true of nodisp. See above: examples_usageMyron Turner 2020-03-13 16:53

1)
acl 2
2)
acl 4
plugin/nodisp.1628086711.txt.gz · Last modified: 2021-08-04 16:18 by turnermm

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