[pmwiki-users] Properties

Martin Fick fick at fgm.com
Mon Dec 12 14:03:06 CST 2005


On Mon, Dec 12, 2005 at 11:10:53AM -0600, Patrick R. Michaud wrote:
> I'm thinking of adding something like Cookbook.Properties into the
> core distribution, but want to get feedback (especially Dominique's)
> on the markup, since what I'm thinking of using differs somewhat from
> the recipe version.

Integrated properties, awesome!! :)


> * The markup {$property name} becomes the current value of the
>   named property (if the property is not set, then nothing is displayed).
>   We may end up with a shorter markup for this -- maybe {$$name},
>   which would also work in skin templates and $...Fmt strings.
> 

> * Three properties are predefined by PmWiki as saved properties:  title, 
>   keywords, and description.  Thus the (:title:), (:keywords:), and 
>   (:description:) directives become shortcut markups for doing the 
>   equivalent of (:property title="...":), (:property keywords="...":), 
>   and (:property description="...":).

No big deal, but I guess this would mean we would have
{$Title}, and {$$Title} being the same thing?



> * Saved properties can be used as ordering criteria in pagelists,
>   thus  (:pagelist order=myprop:) would order the list according to
>   the "myprop" saved property setting.
> 
> * We may also be able to use saved properties as filters, thus
>   (:pagelist myprop=something:) would return only those pages
>   that have a "myprop" value with "something" in it.

Uhm, syntax might conflict with existing options: does
(:pagelist trail=foo:)  look for the property foo in pages
or does it take the pagelist from page foo?


Maybe (:pagelist trail:foo:) to indicate properties?



> With the above in mind, we would get the following:
> 
> * DaveG's issue of displaying an author-specified WikiTrail in
>   the header can be done with properties and no special markup
>   rules.  By placing the following in the page template
> 
>       <!--markup:(:if property titletrail:)<<|[[{$$titletrail}]]|>>(:if:)-->
> 
>   the markup (:property titletrail "DIY":) would result in
>   displaying the DIY trail in the page header.

Are there any toughts of making COOKIES, REQUEST vars etc.
available as properties or variables?




> * The "custom variables" in Cookbook.PageListTemplates could become 
>   "properties" of the current page in the list, thus
> 
>       {$$prevname}       - previous page in list
>       {$$nextname}       - next page in list
>       {$$pagecount}      - current page count
>       {$$grouppagecount} - count of pages in current group
>       {$$groupcount}     - number of groups

I get what you mean, but I think they would not actually be
properties of the current page but of the current template.



> * If we define a markup rule that treats markup lines of the form
> 
>       name: value
> 
>   as setting a property value (i.e., the same as (:property name="value":), 
>   then capabilities such as PITS become almost trivial to implement, 
>   including the ability to sort and filter based on properties in the 
>   page markup.  Example property lines that could be of great benefit
>   (we'll assume that properties are case-insensitive here, although that's
>   not decided):
> 
>       Summary: this is the page's summary    # (allows {$$summary} )
>       Created: 2005-08-26                    # (allows order=-created)
>       Status: Closed                         # (allows summary=closed)
>       Votes:  53024                          # (allows order=-votes)


Very neat, but I would fear that a lot of properties would
be getting set unintentionally.  Within a page this would be
no big deal, but it would make it hard to get good results
from pagelists.



-Martin





More information about the pmwiki-users mailing list