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:)
  • 01557: Support Closures in FmtPV
  • 01555: Disable editing in default installation
  • 01556: Two bugs in pm_json_encode()
  • 01319: preg_replace with /e modifier deprecated
  • 01492: Many documentation links need fixed
  • 01504: Raising Minimum PHP Version Requirement to 7.0
  • 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.

[[#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.01 00.01 config end
  3: 00.03 00.03 MarkupToHTML begin
  4: 00.03 00.03 MarkupToHTML begin
  5: 00.04 00.04 MarkupToHTML end
  6: 00.04 00.04 MarkupToHTML begin
  7: 00.04 00.04 MarkupToHTML end
  8: 00.04 00.04 MarkupToHTML begin
  9: 00.05 00.04 MarkupToHTML end
 10: 00.05 00.04 MarkupToHTML begin
 11: 00.05 00.04 MarkupToHTML end
 12: 00.05 00.04 MarkupToHTML begin
 13: 00.05 00.04 FPLTemplate: Chain begin
 14: 00.05 00.04 FPLTemplate: FPLTemplateLoad
 15: 00.05 00.04 FPLTemplate: FPLTemplateDefaults
 16: 00.05 00.04 FPLTemplate: FPLTemplatePageList
 17: 00.05 00.04 MakePageList pre
 18: 00.05 00.04 PageListSources begin
 19: 00.05 00.04 PageStore::ls begin wiki.d/{$FullName}
 20: 00.06 00.04 PageStore::ls merge wiki.d/{$FullName}
 21: 00.06 00.05 PageStore::ls end wiki.d/{$FullName}
 22: 00.06 00.05 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 23: 00.06 00.05 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 24: 00.06 00.05 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 25: 00.06 00.05 PageListSources end count=2354
 26: 00.06 00.05 PageListTermsTargets begin count=2354
 27: 00.06 00.05 PageIndexGrep begin
 28: 00.09 00.08 PageIndexGrep end
 29: 00.10 00.08 PageListTermsTargets end count=2213
 30: 00.10 00.08 PageListSort pre ret=4 order=name
 31: 00.10 00.08 MakePageList items count=2213, filters=PageListTermsTargets
 32: 00.71 00.59 MakePageList post count=2202, readc=2213
 33: 00.71 00.59 PageListSort begin
 34: 00.71 00.59 PageListSort sort
 35: 00.74 00.62 PageListSort end
 36: 00.74 00.62 MakePageList end
 37: 00.74 00.62 FPLTemplate: FPLTemplatePmWikiOrg
 38: 00.74 00.62 MarkupToHTML begin
 39: 00.74 00.62 MarkupToHTML end
 40: 00.74 00.62 FPLTemplate: FPLTemplateSliceList
 41: 00.74 00.62 FPLTemplate: FPLTemplateFormat
 42: 00.75 00.63 MarkupToHTML begin
 43: 00.76 00.64 MarkupToHTML end
 44: 00.76 00.64 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 45: 00.76 00.64 FPLTemplate: Chain end
 46: 00.76 00.64 MarkupToHTML end
 47: 00.76 00.64 MarkupToHTML begin
 48: 00.76 00.64 FPLTemplate: Chain begin
 49: 00.76 00.64 FPLTemplate: FPLTemplateLoad
 50: 00.76 00.64 FPLTemplate: FPLTemplateDefaults
 51: 00.76 00.64 FPLTemplate: FPLTemplatePageList
 52: 00.76 00.64 MakePageList pre
 53: 00.76 00.64 PageListSources begin
 54: 00.76 00.64 PageStore::ls begin wiki.d/{$FullName}
 55: 00.77 00.65 PageStore::ls merge wiki.d/{$FullName}
 56: 00.77 00.65 PageStore::ls end wiki.d/{$FullName}
 57: 00.77 00.65 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 58: 00.77 00.65 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 59: 00.77 00.65 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 60: 00.77 00.65 PageListSources end count=1571
 61: 00.77 00.65 PageListTermsTargets begin count=1571
 62: 00.77 00.65 PageIndexGrep begin
 63: 00.80 00.67 PageIndexGrep end
 64: 00.80 00.67 PageListTermsTargets end count=1563
 65: 00.80 00.67 PageListSort pre ret=6 order=-time
 66: 00.80 00.67 MakePageList items count=1563, filters=PageListTermsTargets,PageListSort
 67: 01.08 00.90 MakePageList post count=1561, readc=1563
 68: 01.08 00.90 PageListSort begin
 69: 01.08 00.90 PageListSort sort
 70: 01.09 00.91 PageListSort end
 71: 01.09 00.91 MakePageList end
 72: 01.09 00.91 FPLTemplate: FPLTemplatePmWikiOrg
 73: 01.09 00.91 MarkupToHTML begin
 74: 01.09 00.92 MarkupToHTML end
 75: 01.09 00.92 FPLTemplate: FPLTemplateSliceList
 76: 01.09 00.92 FPLTemplate: FPLTemplateFormat
 77: 01.10 00.92 MarkupToHTML begin
 78: 01.11 00.93 MarkupToHTML end
 79: 01.11 00.93 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
 80: 01.11 00.93 FPLTemplate: Chain end
 81: 01.11 00.93 MarkupToHTML end
 82: 01.11 00.93 MarkupToHTML begin
 83: 01.11 00.93 FPLTemplate: Chain begin
 84: 01.11 00.93 FPLTemplate: FPLTemplateLoad
 85: 01.11 00.93 FPLTemplate: FPLTemplateDefaults
 86: 01.11 00.93 FPLTemplate: FPLTemplatePageList
 87: 01.11 00.93 MakePageList pre
 88: 01.11 00.93 PageListSources begin
 89: 01.11 00.93 PageStore::ls begin wiki.d/{$FullName}
 90: 01.11 00.93 PageStore::ls merge wiki.d/{$FullName}
 91: 01.12 00.93 PageStore::ls end wiki.d/{$FullName}
 92: 01.12 00.93 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 93: 01.12 00.93 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 94: 01.12 00.93 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 95: 01.12 00.93 PageListSources end count=6
 96: 01.12 00.93 PageListTermsTargets begin count=6
 97: 01.12 00.93 PageIndexGrep begin
 98: 01.16 00.96 PageIndexGrep end
 99: 01.16 00.96 PageListTermsTargets end count=6
100: 01.16 00.96 PageListSort pre ret=4 order=name
101: 01.16 00.96 MakePageList items count=6, filters=PageListTermsTargets
102: 01.16 00.97 MakePageList post count=6, readc=6
103: 01.16 00.97 PageListSort begin
104: 01.16 00.97 PageListSort sort
105: 01.16 00.97 PageListSort end
106: 01.16 00.97 MakePageList end
107: 01.16 00.97 FPLTemplate: FPLTemplatePmWikiOrg
108: 01.16 00.97 MarkupToHTML begin
109: 01.16 00.97 MarkupToHTML end
110: 01.16 00.97 FPLTemplate: FPLTemplateSliceList
111: 01.16 00.97 FPLTemplate: FPLTemplateFormat
112: 01.16 00.97 MarkupToHTML begin
113: 01.17 00.97 MarkupToHTML end
114: 01.17 00.97 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
115: 01.17 00.97 FPLTemplate: Chain end
116: 01.17 00.98 MarkupToHTML end
117: 01.17 00.98 MarkupToHTML begin
118: 01.17 00.98 FPLTemplate: Chain begin
119: 01.17 00.98 FPLTemplate: FPLTemplateLoad
120: 01.17 00.98 FPLTemplate: FPLTemplateDefaults
121: 01.17 00.98 FPLTemplate: FPLTemplatePageList
122: 01.17 00.98 MakePageList pre
123: 01.17 00.98 PageListSources begin
124: 01.17 00.98 PageStore::ls begin wiki.d/{$FullName}
125: 01.18 00.98 PageStore::ls merge wiki.d/{$FullName}
126: 01.18 00.98 PageStore::ls end wiki.d/{$FullName}
127: 01.18 00.98 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
128: 01.18 00.98 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
129: 01.18 00.98 PageStore::ls end $FarmD/wikilib.d/{$FullName}
130: 01.18 00.98 PageListSources end count=6
131: 01.18 00.98 PageListTermsTargets begin count=6
132: 01.18 00.98 PageIndexGrep begin
133: 01.21 01.01 PageIndexGrep end
134: 01.21 01.01 PageListTermsTargets end count=6
135: 01.21 01.01 PageListSort pre ret=4 order=name
136: 01.21 01.01 MakePageList items count=6, filters=PageListTermsTargets
137: 01.21 01.01 MakePageList post count=6, readc=6
138: 01.21 01.01 PageListSort begin
139: 01.21 01.01 PageListSort sort
140: 01.21 01.01 PageListSort end
141: 01.21 01.01 MakePageList end
142: 01.21 01.01 FPLTemplate: FPLTemplatePmWikiOrg
143: 01.21 01.01 MarkupToHTML begin
144: 01.21 01.01 MarkupToHTML end
145: 01.21 01.01 FPLTemplate: FPLTemplateSliceList
146: 01.21 01.01 FPLTemplate: FPLTemplateFormat
147: 01.21 01.01 MarkupToHTML begin
148: 01.22 01.01 MarkupToHTML end
149: 01.22 01.01 FPLTemplate: FPLTemplatePmWikiOrgPostFormat
150: 01.22 01.01 FPLTemplate: Chain end
151: 01.22 01.01 MarkupToHTML end
152: 01.22 01.01 MarkupToHTML begin
153: 01.22 01.01 MarkupToHTML end
154: 01.22 01.01 MarkupToHTML begin
155: 01.22 01.02 MarkupToHTML end
156: 01.24 01.03 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
157: 01.24 01.04 ReadApprovedUrls SiteAdmin.ApprovedUrls end
158: 01.25 01.05 MarkupToHTML end
159: 01.26 01.05 MarkupToHTML begin
160: 01.27 01.06 MarkupToHTML end
161: 01.27 01.06 MarkupToHTML begin
162: 01.28 01.07 MarkupToHTML end
163: 01.28 01.07 now
Peak memory: 11,846,872 bytes