PData


This is testing the new PData capability, and the {$:var} markup.

First, some data that we can look at:

Field1: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Field2: Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
Field3: Nisi ut aliquip.

To grab the value of a field from the current page, use {$:Field1}:

  Field1 = {$:Field1}
  Field2 = {$:Field2}
  Field3 = {$:Field3}
  Field1 = Lorem ipsum dolor sit amet, consectetur adipisicing elit. 
  Field2 = Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
  Field3 = Nisi ut aliquip.

To grab the value of a field from another page, use {pagename$:Field1} (here the data is coming from TestData):

  {TestData$:ABC}
  {TestData$:DEF}
  alpha beta charlie
  delta echo foxtrot

Some other examples, grabbing Summary lines from Cookbook and PITS pages:

  {PITS.00565$:Summary}
  {Cookbook.RandomQuote$:Summary}
  {Cookbook.RandomQuote$:Version}
  Placeholder for 2.1 features
  Insert random quotes or markup into a page
  2007-02-15

The data can also come from definition lists (currently definitions have to be a single word):

:apple:green
:banana:yellow
:cherry:red

{$:apple} {$:banana} {$:cherry}
apple
green
banana
yellow
cherry
red

green yellow red

The {$:var} markup can also be used in page templates:

[[#summary]]
* [[{=$Group}/{=$Name}]]: {=$:Summary}
[[#summaryend]]
(:pagelist fmt=#summary group=Cookbook "Summary:" count=10:)
(:pagelist fmt=#summary group=PITS "Summary:" count=10 order=-time:)
  • 01545: Pagelist parameters should always be treated as such, even if the value is, or resolves to, null
  • 01551: add markups hideactions and showactions
  • 01554: Configure default PTV values from a wiki page
  • 01553: Reference to PmWiki variables.
  • 01509: Deprecate rarely used upload extensions from the core
  • 01552: Simple table heading and anchors
  • 01539: fopen URL usage
  • 01538: RecipeCheck to handle fopen gracefully
  • 00028: Turn PmWiki into a full-fledged blogging tool
  • 01413: Custom PageStore receives requests for file system paths

[[#showthumbs2]]
(:if equal {<$Group}:)
>>lframe width=300px<<
(:if:)[[{=$Name}]] - {=$:Thumbnail}
(:if equal {>$Group}:)
>><<
[[#showthumbs2end]]
(:pagelist fmt=#showthumbs2 group=Test name=EasyGalleryPic* "Thumbnail:" :)

Here is a quick test to see how well the {$:var} markup works with with images and in page templates:

[[#showthumbs]]
(:if equal {<$Group}:)
>>lframe width=300px<<
(:if:)\
{=$:Thumbnail}\
(:if equal {>$Group}:)
>><<
[[#showthumbsend]]

(:pagelist fmt=#showthumbs group=Test name=EasyGalleryPic* "Thumbnail:" :)

Note: This wasn't working. Why?

  • I checked and confirmed that the appropriate pages were being picked up by the pagelist (by leaving links in the template, which I have since removed).
  • I checked and confirmed that the use of images wasn't the problem (by changing substituting text for the thumbnail on one of the pages, which I have since restored)
  • I checked and confirmed that the pages where the definitional markup resides do not need to be enabled (by grabbing a single thumbnail, as shown below)

{Test.EasyGalleryPic1$:Thumbnail}\\
{Test.EasyGalleryPic1$:Thumbnailink}

Haley

Pico September 07, 2006, at 09:10 AM


Is this an upcoming feature or test of some already available recipe?
VKrishn August 30, 2006, at 11:27 AM

It's experimentation, based on things in PITS, the Cookbook, and a discussion on the pmwiki-users mailing list. A good place to start looking at the thread might be http://www.pmichaud.com/pipermail/pmwiki-users/2006-August/031461.html (although it actually begins before that, this message is the one where the {$:var} markup is first introduced). Pm August 30, 2006, at 12:22 PM

I am not sure if there is any PITS entry for this. Please count my vote for this feature. VKrishn September 03, 2006, at 02:37 AM


Will there be a way to escape the colon to allow it to be treated literally as part of the defined value? For example, if I use it for defining titles of works, what happens if the title contains a colon, for example:

Artist: Roy Buchanan Album: Sweet Dreams : The Anthology

Workarounds would presumably include using the ascii code (%3A), or substituting a different character (-), but it might be nice to provide a more intuitive solution. What about allowing optional quotation marks, for example:

Artist: Roy Buchanan Album: "Sweet Dreams : The Anthology"

Pico September 07, 2006, at 09:10 AM

Only the first colon matters; the rest is left alone. For example:

Example: This example contains a colon:  Look, it works!

The value of example is "{$:Example}".

Example: This example contains a colon: Look, it works!

The value of example is "This example contains a colon: Look, it works!".

Pm


Some oddness with "directive" values

MyField1:the first value

MyField2
a DL value
  1. the first value
  2. a DL value
  3. a "directive" value
  4. And Foo is another "directive" value

Kathryn Andersen September 26, 2006, at 02:32 AM

  0: 00.00 00.00 EnablePost = 1, keys=
  1: 00.00 00.00 config start
  2: 00.02 00.01 config end
  3: 00.04 00.03 MarkupToHTML begin
  4: 00.04 00.03 MarkupToHTML begin
  5: 00.05 00.04 MarkupToHTML end
  6: 00.05 00.04 MarkupToHTML begin
  7: 00.05 00.04 MarkupToHTML end
  8: 00.05 00.04 MarkupToHTML begin
  9: 00.05 00.04 MarkupToHTML end
 10: 00.05 00.04 MarkupToHTML begin
 11: 00.05 00.05 MarkupToHTML end
 12: 00.05 00.05 MarkupToHTML begin
 13: 00.05 00.05 FPLTemplate: Chain begin
 14: 00.05 00.05 FPLTemplate: FPLTemplateLoad
 15: 00.05 00.05 FPLTemplate: FPLTemplateDefaults
 16: 00.05 00.05 FPLTemplate: FPLTemplatePageList
 17: 00.05 00.05 MakePageList pre
 18: 00.05 00.05 PageListSources begin
 19: 00.05 00.05 PageStore::ls begin wiki.d/{$FullName}
 20: 00.06 00.05 PageStore::ls merge wiki.d/{$FullName}
 21: 00.06 00.05 PageStore::ls end wiki.d/{$FullName}
 22: 00.06 00.06 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 23: 00.06 00.06 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 24: 00.06 00.06 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 25: 00.07 00.06 PageListSources end count=2353
 26: 00.07 00.06 PageListTermsTargets begin count=2353
 27: 00.07 00.06 PageIndexGrep begin
 28: 00.09 00.08 PageIndexGrep end
 29: 00.09 00.08 PageListTermsTargets end count=2212
 30: 00.09 00.08 PageListSort pre ret=4 order=name
 31: 00.09 00.08 MakePageList items count=2212, filters=PageListTermsTargets
 32: 00.69 00.59 MakePageList post count=2201, readc=2212
 33: 00.69 00.59 PageListSort begin
 34: 00.69 00.59 PageListSort sort
 35: 00.72 00.62 PageListSort end
 36: 00.72 00.62 MakePageList end
 37: 00.72 00.62 FPLTemplate: FPLTemplatePmWikiOrg
 38: 00.72 00.62 MarkupToHTML begin
 39: 00.72 00.62 MarkupToHTML end
 40: 00.72 00.62 FPLTemplate: FPLTemplateSliceList
 41: 00.72 00.62 FPLTemplate: FPLTemplateFormat
 42: 00.73 00.63 MarkupToHTML begin
 43: 00.74 00.63 MarkupToHTML end
 44: 00.74 00.63 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 45: 00.74 00.63 FPLTemplate: Chain end
 46: 00.74 00.64 MarkupToHTML end
 47: 00.74 00.64 MarkupToHTML begin
 48: 00.74 00.64 FPLTemplate: Chain begin
 49: 00.74 00.64 FPLTemplate: FPLTemplateLoad
 50: 00.74 00.64 FPLTemplate: FPLTemplateDefaults
 51: 00.74 00.64 FPLTemplate: FPLTemplatePageList
 52: 00.74 00.64 MakePageList pre
 53: 00.74 00.64 PageListSources begin
 54: 00.74 00.64 PageStore::ls begin wiki.d/{$FullName}
 55: 00.75 00.64 PageStore::ls merge wiki.d/{$FullName}
 56: 00.75 00.64 PageStore::ls end wiki.d/{$FullName}
 57: 00.75 00.64 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 58: 00.75 00.64 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 59: 00.75 00.64 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 60: 00.75 00.64 PageListSources end count=1568
 61: 00.75 00.64 PageListTermsTargets begin count=1568
 62: 00.75 00.64 PageIndexGrep begin
 63: 00.77 00.66 PageIndexGrep end
 64: 00.78 00.66 PageListTermsTargets end count=1560
 65: 00.78 00.66 PageListSort pre ret=6 order=-time
 66: 00.78 00.66 MakePageList items count=1560, filters=PageListTermsTargets,PageListSort
 67: 01.05 00.88 MakePageList post count=1558, readc=1560
 68: 01.05 00.88 PageListSort begin
 69: 01.05 00.88 PageListSort sort
 70: 01.07 00.89 PageListSort end
 71: 01.07 00.89 MakePageList end
 72: 01.07 00.89 FPLTemplate: FPLTemplatePmWikiOrg
 73: 01.07 00.89 MarkupToHTML begin
 74: 01.07 00.89 MarkupToHTML end
 75: 01.07 00.89 FPLTemplate: FPLTemplateSliceList
 76: 01.07 00.89 FPLTemplate: FPLTemplateFormat
 77: 01.08 00.90 MarkupToHTML begin
 78: 01.08 00.90 MarkupToHTML end
 79: 01.08 00.90 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 80: 01.08 00.90 FPLTemplate: Chain end
 81: 01.08 00.90 MarkupToHTML end
 82: 01.08 00.90 MarkupToHTML begin
 83: 01.08 00.90 FPLTemplate: Chain begin
 84: 01.08 00.90 FPLTemplate: FPLTemplateLoad
 85: 01.08 00.90 FPLTemplate: FPLTemplateDefaults
 86: 01.08 00.90 FPLTemplate: FPLTemplatePageList
 87: 01.08 00.90 MakePageList pre
 88: 01.08 00.90 PageListSources begin
 89: 01.08 00.90 PageStore::ls begin wiki.d/{$FullName}
 90: 01.09 00.91 PageStore::ls merge wiki.d/{$FullName}
 91: 01.09 00.91 PageStore::ls end wiki.d/{$FullName}
 92: 01.09 00.91 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 93: 01.09 00.91 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 94: 01.09 00.91 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 95: 01.09 00.91 PageListSources end count=6
 96: 01.09 00.91 PageListTermsTargets begin count=6
 97: 01.09 00.91 PageIndexGrep begin
 98: 01.12 00.93 PageIndexGrep end
 99: 01.12 00.93 PageListTermsTargets end count=6
100: 01.12 00.93 PageListSort pre ret=4 order=name
101: 01.12 00.93 MakePageList items count=6, filters=PageListTermsTargets
102: 01.12 00.93 MakePageList post count=6, readc=6
103: 01.12 00.93 PageListSort begin
104: 01.12 00.93 PageListSort sort
105: 01.12 00.93 PageListSort end
106: 01.12 00.93 MakePageList end
107: 01.12 00.93 FPLTemplate: FPLTemplatePmWikiOrg
108: 01.12 00.93 MarkupToHTML begin
109: 01.12 00.93 MarkupToHTML end
110: 01.12 00.93 FPLTemplate: FPLTemplateSliceList
111: 01.12 00.93 FPLTemplate: FPLTemplateFormat
112: 01.13 00.93 MarkupToHTML begin
113: 01.13 00.94 MarkupToHTML end
114: 01.13 00.94 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
115: 01.13 00.94 FPLTemplate: Chain end
116: 01.13 00.94 MarkupToHTML end
117: 01.13 00.94 MarkupToHTML begin
118: 01.13 00.94 FPLTemplate: Chain begin
119: 01.13 00.94 FPLTemplate: FPLTemplateLoad
120: 01.14 00.94 FPLTemplate: FPLTemplateDefaults
121: 01.14 00.94 FPLTemplate: FPLTemplatePageList
122: 01.14 00.94 MakePageList pre
123: 01.14 00.94 PageListSources begin
124: 01.14 00.94 PageStore::ls begin wiki.d/{$FullName}
125: 01.14 00.95 PageStore::ls merge wiki.d/{$FullName}
126: 01.14 00.95 PageStore::ls end wiki.d/{$FullName}
127: 01.14 00.95 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
128: 01.14 00.95 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
129: 01.14 00.95 PageStore::ls end $FarmD/wikilib.d/{$FullName}
130: 01.14 00.95 PageListSources end count=6
131: 01.14 00.95 PageListTermsTargets begin count=6
132: 01.14 00.95 PageIndexGrep begin
133: 01.17 00.97 PageIndexGrep end
134: 01.17 00.97 PageListTermsTargets end count=6
135: 01.17 00.97 PageListSort pre ret=4 order=name
136: 01.17 00.97 MakePageList items count=6, filters=PageListTermsTargets
137: 01.17 00.98 MakePageList post count=6, readc=6
138: 01.17 00.98 PageListSort begin
139: 01.17 00.98 PageListSort sort
140: 01.17 00.98 PageListSort end
141: 01.17 00.98 MakePageList end
142: 01.17 00.98 FPLTemplate: FPLTemplatePmWikiOrg
143: 01.18 00.98 MarkupToHTML begin
144: 01.18 00.98 MarkupToHTML end
145: 01.18 00.98 FPLTemplate: FPLTemplateSliceList
146: 01.18 00.98 FPLTemplate: FPLTemplateFormat
147: 01.18 00.98 MarkupToHTML begin
148: 01.18 00.98 MarkupToHTML end
149: 01.18 00.98 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
150: 01.18 00.98 FPLTemplate: Chain end
151: 01.18 00.98 MarkupToHTML end
152: 01.18 00.98 MarkupToHTML begin
153: 01.18 00.98 MarkupToHTML end
154: 01.18 00.98 MarkupToHTML begin
155: 01.18 00.98 MarkupToHTML end
156: 01.20 01.00 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
157: 01.20 01.00 ReadApprovedUrls SiteAdmin.ApprovedUrls end
158: 01.21 01.01 MarkupToHTML end
159: 01.22 01.01 MarkupToHTML begin
160: 01.23 01.03 MarkupToHTML end
161: 01.23 01.03 MarkupToHTML begin
162: 01.23 01.03 MarkupToHTML end
163: 01.24 01.03 now
Peak memory: 11,804,416 bytes