[pmwiki-devel] Accessing new page attributes / property

Petko Yotov 5ko at 5ko.fr
Fri Jan 2 23:47:15 CST 2009


On Saturday 03 January 2009 06:01:25 DaveG wrote:
> > You need to also add a PageVariable :
> >   $FmtPV['$mine'] = '$page["mine"]';
>
> Thanks, that works. I'm putting this on the wiki, as I didn't find it
> anywhere. Do these level of attributes already have a name?

See the examples near the bottom of this  page :
   http://pmwiki.org/wiki/PmWiki/PageVariables

See also Cookbook:MoreCustomPageVariables.

Currently, it should be much easier to use a custom Cookbook:MarkupExpressions 
function do display similar properties of each page.

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. 

This is an advanced "capability" of PmWiki, you are messing with the core file 
format, and you should know what you are doing. Adding attributes could make 
the wiki slower or not work in some cases : for example a custom PageStore 
class that knows nothing of your recipe (one such class, SQLite, should work 
though). Also check if the hardcoded sort function for the page array is not 
placing your attribute at the bottom of the actual file (function 
CmpPageAttr() -- called from class PageStore, function write).

Good luck,
Petko



More information about the pmwiki-devel mailing list