[pmwiki-users] Is there a way to have a "default" markup for an unknown or empty page text variable?

Petko Yotov 5ko at 5ko.fr
Wed Oct 30 02:56:07 PDT 2019

I've added this for 2.2.121 (you can get the pre-release as a ZIP file 
or from Subversion here:


Only pmwiki.php was modified for this feature since 2.2.120.

The documentation for this is here:


Note that it doesn't distinguish "var not defined in page" from "user 
has no permissions for page". But if you *know* that a specific variable 
*is* defined in a specific protected page and it looks like unset, then 
the user doesn't have read permissions.

For example, in config.php:

   $DefaultUnsetPageTextVars['AdminTasks'] =
    '[[SiteAdmin.Tasks?action=login|login to see your tasks]]';

then e.g. in Site.SideBar:


With earlier PmWiki versions you could use a conditional:

   (:if auth read SiteAdmin.Tasks:)
   [[SiteAdmin.Tasks?action=login|login to see your tasks]]

If the value is a single line without quotes, you could alternatively 

   (:if equal "" "{SiteAdmin.Tasks$:AdminTasks}":)
   (no permissions)



If you upgrade :  http://www.pmwiki.org/Upgrades

On 29/10/2019 22:35, Christopher Cox wrote:
> Is there a way to have a "default" markup for an unknown or empty page
> text variable?
> Specifically, might be nice for "something" to show up for a PTV for
> which somebody can't access because of permissions, but I'm ok with
> some sort of general case.  Possible?
> I'm ok with enabling such via special per group/page php.
> But doesn't seem possible at all today?  Like a
> PCache[pagename]["=p_<whatever>] default set in PageTextVar even for
> situations where the PCache can't be fetched due to permissions.
> Something like that.

More information about the pmwiki-users mailing list