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:)
  • 00719: Add (:input image:) markup for image buttons
  • 01444: TrueLatex? Cookbook
  • 01443: Various Wikitags not working on PHP 7.3
  • 00473: Memory problems with 2.0 (Search, AllRecentChanges?)
  • 00608: A recipe for writing lyrics blocks (i.e. auto-line-breaks)
  • 00774: Pagelist format not found behavior
  • 01046: Search/pagelist for markups by their id and display the content of the found markup as result
  • 01295: Attachments in IE7?-IE8? over HTTPS without direct download
  • 01298: Page variable for Page directives
  • 01352: Upper case Q and A (but no other letters) disappear when used as page text variables

[[#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 config start
  1: 00.00 00.00 config end
  2: 00.05 00.02 MarkupToHTML begin
  3: 00.06 00.02 MarkupToHTML begin
  4: 00.07 00.03 MarkupToHTML end
  5: 00.07 00.03 MarkupToHTML begin
  6: 00.07 00.03 MarkupToHTML end
  7: 00.07 00.03 MarkupToHTML begin
  8: 00.08 00.03 MarkupToHTML end
  9: 00.08 00.03 MarkupToHTML begin
 10: 00.09 00.04 MarkupToHTML end
 11: 00.09 00.04 MarkupToHTML begin
 12: 00.09 00.04 FPLTemplate: Chain begin
 13: 00.09 00.04 FPLTemplate: FPLTemplateLoad
 14: 00.09 00.04 FPLTemplate: FPLTemplateDefaults
 15: 00.09 00.04 FPLTemplate: FPLTemplatePageList
 16: 00.09 00.04 MakePageList pre
 17: 00.09 00.04 PageListSources begin
 18: 00.09 00.04 PageStore::ls begin wiki.d/{$FullName}
 19: 00.11 00.04 PageStore::ls merge wiki.d/{$FullName}
 20: 00.11 00.05 PageStore::ls end wiki.d/{$FullName}
 21: 00.11 00.05 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 22: 00.11 00.05 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 23: 00.11 00.05 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 24: 00.11 00.05 PageListSources end count=2179
 25: 00.11 00.05 PageListTermsTargets begin count=2179
 26: 00.11 00.05 PageIndexGrep begin
 27: 00.17 00.07 PageIndexGrep end
 28: 00.17 00.07 PageListTermsTargets end count=2037
 29: 00.17 00.07 PageListSort pre ret=4 order=name
 30: 00.17 00.07 MakePageList items count=2037, filters=PageListTermsTargets
 31: 00.85 00.61 MakePageList post count=2026, readc=2037
 32: 00.85 00.61 PageListSort begin
 33: 00.85 00.61 PageListSort sort
 34: 00.89 00.65 PageListSort end
 35: 00.89 00.65 MakePageList end
 36: 00.89 00.65 FPLTemplate: FPLTemplatePmWikiOrg
 37: 00.89 00.65 MarkupToHTML begin
 38: 00.90 00.65 MarkupToHTML end
 39: 00.90 00.65 FPLTemplate: FPLTemplateSliceList
 40: 00.90 00.65 FPLTemplate: FPLTemplateFormat
 41: 00.90 00.66 MarkupToHTML begin
 42: 00.91 00.67 MarkupToHTML end
 43: 00.91 00.67 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 44: 00.91 00.67 FPLTemplate: Chain end
 45: 00.91 00.67 MarkupToHTML end
 46: 00.91 00.67 MarkupToHTML begin
 47: 00.91 00.67 FPLTemplate: Chain begin
 48: 00.91 00.67 FPLTemplate: FPLTemplateLoad
 49: 00.91 00.67 FPLTemplate: FPLTemplateDefaults
 50: 00.91 00.67 FPLTemplate: FPLTemplatePageList
 51: 00.91 00.67 MakePageList pre
 52: 00.91 00.67 PageListSources begin
 53: 00.91 00.67 PageStore::ls begin wiki.d/{$FullName}
 54: 00.92 00.68 PageStore::ls merge wiki.d/{$FullName}
 55: 00.92 00.68 PageStore::ls end wiki.d/{$FullName}
 56: 00.92 00.68 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 57: 00.92 00.68 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 58: 00.92 00.68 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 59: 00.92 00.68 PageListSources end count=1458
 60: 00.92 00.68 PageListTermsTargets begin count=1458
 61: 00.92 00.68 PageIndexGrep begin
 62: 00.95 00.70 PageIndexGrep end
 63: 00.95 00.70 PageListTermsTargets end count=1450
 64: 00.95 00.70 PageListSort pre ret=6 order=-time
 65: 00.95 00.70 MakePageList items count=1450, filters=PageListTermsTargets,PageListSort
 66: 01.21 00.93 MakePageList post count=1448, readc=1450
 67: 01.21 00.93 PageListSort begin
 68: 01.21 00.93 PageListSort sort
 69: 01.23 00.95 PageListSort end
 70: 01.23 00.95 MakePageList end
 71: 01.23 00.95 FPLTemplate: FPLTemplatePmWikiOrg
 72: 01.23 00.95 MarkupToHTML begin
 73: 01.23 00.95 MarkupToHTML end
 74: 01.23 00.95 FPLTemplate: FPLTemplateSliceList
 75: 01.23 00.95 FPLTemplate: FPLTemplateFormat
 76: 01.24 00.95 MarkupToHTML begin
 77: 01.24 00.96 MarkupToHTML end
 78: 01.24 00.96 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 79: 01.24 00.96 FPLTemplate: Chain end
 80: 01.25 00.96 MarkupToHTML end
 81: 01.25 00.96 MarkupToHTML begin
 82: 01.25 00.96 FPLTemplate: Chain begin
 83: 01.25 00.96 FPLTemplate: FPLTemplateLoad
 84: 01.25 00.96 FPLTemplate: FPLTemplateDefaults
 85: 01.25 00.96 FPLTemplate: FPLTemplatePageList
 86: 01.25 00.96 MakePageList pre
 87: 01.25 00.96 PageListSources begin
 88: 01.25 00.96 PageStore::ls begin wiki.d/{$FullName}
 89: 01.25 00.97 PageStore::ls merge wiki.d/{$FullName}
 90: 01.26 00.97 PageStore::ls end wiki.d/{$FullName}
 91: 01.26 00.97 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 92: 01.26 00.97 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 93: 01.26 00.97 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 94: 01.26 00.97 PageListSources end count=6
 95: 01.26 00.97 PageListTermsTargets begin count=6
 96: 01.26 00.97 PageIndexGrep begin
 97: 01.29 00.99 PageIndexGrep end
 98: 01.29 01.00 PageListTermsTargets end count=6
 99: 01.29 01.00 PageListSort pre ret=4 order=name
100: 01.29 01.00 MakePageList items count=6, filters=PageListTermsTargets
101: 01.29 01.00 MakePageList post count=6, readc=6
102: 01.29 01.00 PageListSort begin
103: 01.29 01.00 PageListSort sort
104: 01.29 01.00 PageListSort end
105: 01.29 01.00 MakePageList end
106: 01.29 01.00 FPLTemplate: FPLTemplatePmWikiOrg
107: 01.29 01.00 MarkupToHTML begin
108: 01.29 01.00 MarkupToHTML end
109: 01.29 01.00 FPLTemplate: FPLTemplateSliceList
110: 01.29 01.00 FPLTemplate: FPLTemplateFormat
111: 01.29 01.00 MarkupToHTML begin
112: 01.30 01.00 MarkupToHTML end
113: 01.30 01.00 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
114: 01.30 01.00 FPLTemplate: Chain end
115: 01.30 01.00 MarkupToHTML end
116: 01.30 01.00 MarkupToHTML begin
117: 01.30 01.00 FPLTemplate: Chain begin
118: 01.30 01.00 FPLTemplate: FPLTemplateLoad
119: 01.30 01.00 FPLTemplate: FPLTemplateDefaults
120: 01.30 01.00 FPLTemplate: FPLTemplatePageList
121: 01.30 01.00 MakePageList pre
122: 01.30 01.00 PageListSources begin
123: 01.30 01.00 PageStore::ls begin wiki.d/{$FullName}
124: 01.31 01.01 PageStore::ls merge wiki.d/{$FullName}
125: 01.31 01.01 PageStore::ls end wiki.d/{$FullName}
126: 01.31 01.01 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
127: 01.31 01.01 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
128: 01.31 01.01 PageStore::ls end $FarmD/wikilib.d/{$FullName}
129: 01.31 01.01 PageListSources end count=6
130: 01.31 01.01 PageListTermsTargets begin count=6
131: 01.31 01.01 PageIndexGrep begin
132: 01.34 01.04 PageIndexGrep end
133: 01.34 01.04 PageListTermsTargets end count=6
134: 01.34 01.04 PageListSort pre ret=4 order=name
135: 01.34 01.04 MakePageList items count=6, filters=PageListTermsTargets
136: 01.34 01.04 MakePageList post count=6, readc=6
137: 01.34 01.04 PageListSort begin
138: 01.34 01.04 PageListSort sort
139: 01.34 01.04 PageListSort end
140: 01.34 01.04 MakePageList end
141: 01.34 01.04 FPLTemplate: FPLTemplatePmWikiOrg
142: 01.34 01.04 MarkupToHTML begin
143: 01.34 01.04 MarkupToHTML end
144: 01.34 01.04 FPLTemplate: FPLTemplateSliceList
145: 01.34 01.04 FPLTemplate: FPLTemplateFormat
146: 01.34 01.04 MarkupToHTML begin
147: 01.34 01.04 MarkupToHTML end
148: 01.34 01.04 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
149: 01.34 01.04 FPLTemplate: Chain end
150: 01.34 01.05 MarkupToHTML end
151: 01.34 01.05 MarkupToHTML begin
152: 01.35 01.05 MarkupToHTML end
153: 01.35 01.05 MarkupToHTML begin
154: 01.35 01.05 MarkupToHTML end
155: 01.36 01.06 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
156: 01.37 01.07 ReadApprovedUrls SiteAdmin.ApprovedUrls end
157: 01.37 01.08 MarkupToHTML end
158: 01.38 01.08 MarkupToHTML begin
159: 01.39 01.09 MarkupToHTML end
160: 01.39 01.09 MarkupToHTML begin
161: 01.39 01.09 MarkupToHTML end
162: 01.39 01.10 now
Peak memory: 10,475,056 bytes