[pmwiki-users] Concealing text on a page

Petko Yotov 5ko at 5ko.fr
Thu Jun 9 09:01:57 PDT 2022


Welcome to PmWiki!

There are 2 ways to have hidden sections, one is easy and convenient but 
not very secure, the other is secure but somewhat less convenient.


The easy way is to use conditionals. In a page, you can have hidden 
sections like this:

   (:if auth admin:)
   This only shows to admins.
   (:ifend:)

The problem with this is, occasionally people might be able to see the 
hidden parts if the actions "diff" and "source" are not sufficiently 
protected, or if they have edit access to any page on the wiki like 
WikiSandbox.

See:
   https://www.pmwiki.org/wiki/PmWiki/ConditionalMarkup


The more secure way is to place the secret content in a separate page, 
protect that page against reading, and include the page (or sections of 
it) into the public page.

In a public page, you can have:
   (:include PrivatePage#section1:)

or:
   (:include PrivateGroup.AnyPage#section1:)


For people with read access to the remote page, this "include" directive 
will be expanded to the text of the other page or section.

For people without read access to the remote page, the directive will be 
empty/blank.

How to include pages or sections, see:
   https://www.pmwiki.org/wiki/PmWiki/IncludeOtherPages

How to password-protect pages, see:
   https://www.pmwiki.org/wiki/PmWiki/Passwords


In any case, you should test your pages with and without admin access to 
make sure it works as you intended.


Petko
-- 
If you upgrade :  https://www.pmwiki.org/Upgrades


On 09/06/2022 17:34, Ben Quant wrote:
> I'm new to pmwiki and using wikis in general. I've set up a pmwiki for 
> a roleplaying group I run to log the details of their adventures and 
> the world we are creating. What I'd like to be able to do is set it up 
> so if I log in with my admin username I can see everything, but if the 
> others log in with a different username, some portions of the text on a 
> page are hidden from them. Is this possible, and if so, how do I go 
> about it?
> 
> Many thanks,
> 
> Ben



More information about the pmwiki-users mailing list