01231: Allow XLPage entries to have empty values

Summary: Allow XLPage entries to have empty values
Created: 2010-11-10 16:09
Status: Closed - workaround
Category: Feature
From: Petko
Priority: 1
Version: 2.2.19

Description: Discussion archived/moved from PmWiki:AccessKeys-Talk.

How to remove access key definitions?

You can change access key definitions by providing a new character for it. But how can we remove a definition (undefined or empty)?
Because the following, currently in PmWikiHu.XLPage, will create 2 access keys with key 'p':

  • 'ak_print' => 'p',
  • 'ak_preview' => '',

The second entry is not making the default 'p' empty, but will keep the default definition. -- SchreyP May 06, 2010, at 07:28 AM

Thinking about it, a solution must be access keys specific, otherwise it could be misused to empty/undefine standard PmWiki prompts... -- SchreyP May 07, 2010, at 06:59 AM

Empty values will be allowed for the next version. We wouldn't worry about misuse of XLPage - normally this page should be write-protected, or any interface prompt could be changed to anything: even if it is not empty, it could be bad. --Petko November 10, 2010, at 03:33 PM

Hi Petko, What is the syntax for defining an "empty" value, because the right part of an XLPage entry like this: => '', is currently interpreted as "Keep the default value". The current XLPages uses a lot of this statements. -- SchreyP November 10, 2010, at 03:49 PM

Just two quotes or appostrophes, 'some default phrase' => '', will work in the next version 2.2.20. (Right now, there is some problem with the source code updating, and some of the new changes will appear shortly). --Petko November 10, 2010, at 03:59 PM

Hm... Right -- I should revert it. I didn't notice that it appears on many XLPages. Suggestions welcome. --Petko November 10, 2010, at 04:06 PM

Because of this current behaviour that '' means "Keep the default value", we will need to define something between the ''.
My suggestion is to use a directive type of markup like (:empty:)
Above example in PmWikiHu.XLPage would than become:

  • 'ak_print' => 'p',
  • 'ak_preview' => '(:empty:)',

SchreyP November 10, 2010, at 04:27 PM

It is possible to set empty values by using a non-defined PageVariable like 'ak_preview' => '{$Empty}', we should just think of a variable name that is unlikely to be used by a custom wiki ($NoPTV, $EmptyPTV, $NoAccessKey...?).

Good idea Petko. So we can make this work without changing the core. If $Empty is not good enough, I suggest $EmptyString .
SchreyP December 20, 2010, at 02:09 PM