[pmwiki-devel] Accessing new page attributes / property

Petko Yotov 5ko at 5ko.fr
Sat Jan 3 12:40:13 CST 2009

On Saturday 03 January 2009 18:39:27 DaveG wrote:
> Petko Yotov wrote:
> > Currently, it should be much easier to use a custom
> > Cookbook:MarkupExpressions function do display similar properties of each
> > page.
> Not sure I follow your meaning here. Are you suggesting using a ME in
> place of the $FmtPV page-variable? If so, what advantages are there?
> Related to the first point, I'm not clear how to store data in a
> MarkupExpression. I can see how to access/display data using the markup,
> but not store it. Perhaps I'm misunderstanding.*

The advantage is that the function could return different values depending on 
the context/user/permissions etc. 
The "storage" is in the form {(myfunc "my stored data")}

> > I feel in most cases it would be simpler/wiser/easier to store such
> > information in PageTextVariables or MarkupExpressions, or custom markup,
> > that all could be manually edited in the page, and not in a
> > PageAttribute.
> I'm storing all other info in PTV's -- but this one attribute I need to
> protect from being edited. The PTV's are being entered via a PmForm. My
> assumption (not yet tested) was that if someone has privs to initially
> create a data page from the PmForm, then they have privs to subsequently
> edit that page -- there's no way to say allow create but not edit. Thus,
> putting the value in a page attribute.

I suppose that value a Username? (An IP address is already stored in the page 

In that case you can probably just place an edit password in the existing 
attribute passwdedit, while creating the page. If you have username:pass 
autentication, you could place such a value in the passwdedit attribute: 
  "id:$AuthId @editors"

assuming that you also have a group named "editors" of users allowed to edit.


P.S. There is always more than one right way to do things, see also 
The recipe allows you even to edit the creator name via ?action=attr.

More information about the pmwiki-devel mailing list