Recent Changes - Search:

PmWiki

pmwiki.org

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

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:)

[[#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

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 12:03 PM
  0: 00.00 00.00 config start
  1: 00.01 00.00 config end
  2: 00.07 00.05 MarkupToHTML begin
  3: 00.07 00.06 MarkupToHTML begin
  4: 00.08 00.07 MarkupToHTML end
  5: 00.08 00.07 MarkupToHTML begin
  6: 00.10 00.07 MarkupToHTML end
  7: 00.10 00.07 MarkupToHTML begin
  8: 00.11 00.08 MarkupToHTML end
  9: 00.11 00.08 MarkupToHTML begin
 10: 00.12 00.09 MarkupToHTML end
 11: 00.12 00.09 MarkupToHTML begin
 12: 00.12 00.09 FPLTemplate: Chain begin
 13: 00.12 00.09 FPLTemplate: FPLTemplateLoad
 14: 00.12 00.09 FPLTemplate: FPLTemplateDefaults
 15: 00.12 00.09 FPLTemplate: FPLTemplatePageList
 16: 00.12 00.09 MakePageList pre
 17: 00.14 00.09 PageListSources begin
 18: 00.14 00.09 PageStore::ls begin wiki.d/{$FullName}
 19: 00.18 00.13 PageStore::ls merge wiki.d/{$FullName}
 20: 00.22 00.16 PageStore::ls end wiki.d/{$FullName}
 21: 00.23 00.17 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 22: 00.23 00.17 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 23: 00.23 00.17 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 24: 00.23 00.17 PageListSources end count=1793
 25: 00.24 00.18 PageListTermsTargets begin count=1793
 26: 00.24 00.18 PageIndexGrep begin
 27: 00.35 00.28 PageIndexGrep end
 28: 00.56 00.48 PageListTermsTargets end count=1653
 29: 00.57 00.48 PageListSort pre ret=4 order=name
 30: 00.57 00.48 MakePageList items count=1653, filters=PageListTermsTargets
 31: 04.93 04.56 MakePageList post count=1640, readc=1653
 32: 04.93 04.56 PageListCache begin save key=a496ecc0e7b5445354468efd35b044e9
 33: 04.94 04.56 PageListCache end save
 34: 04.94 04.56 PageListSort begin
 35: 04.94 04.56 PageListSort sort
 36: 05.05 04.67 PageListSort end
 37: 05.05 04.67 MakePageList end
 38: 05.06 04.68 FPLTemplate: FPLTemplateSliceList
 39: 05.06 04.68 FPLTemplate: FPLTemplateFormat
 40: 05.09 04.71 MarkupToHTML begin
 41: 05.11 04.73 MarkupToHTML end
 42: 05.11 04.73 FPLTemplate: Chain end
 43: 05.11 04.73 MarkupToHTML end
 44: 05.11 04.73 MarkupToHTML begin
 45: 05.12 04.74 FPLTemplate: Chain begin
 46: 05.12 04.74 FPLTemplate: FPLTemplateLoad
 47: 05.12 04.74 FPLTemplate: FPLTemplateDefaults
 48: 05.12 04.74 FPLTemplate: FPLTemplatePageList
 49: 05.12 04.74 MakePageList pre
 50: 05.12 04.74 PageListSources begin
 51: 05.12 04.74 PageStore::ls begin wiki.d/{$FullName}
 52: 05.16 04.77 PageStore::ls merge wiki.d/{$FullName}
 53: 05.19 04.81 PageStore::ls end wiki.d/{$FullName}
 54: 05.20 04.81 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 55: 05.20 04.81 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 56: 05.20 04.81 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 57: 05.21 04.82 PageListSources end count=1326
 58: 05.21 04.82 PageListTermsTargets begin count=1326
 59: 05.21 04.82 PageIndexGrep begin
 60: 05.31 04.92 PageIndexGrep end
 61: 05.52 05.13 PageListTermsTargets end count=1313
 62: 05.53 05.13 PageListSort pre ret=6 order=-time
 63: 05.53 05.13 MakePageList items count=1313, filters=PageListTermsTargets,PageListSort
 64: 07.58 07.14 MakePageList post count=1312, readc=1313
 65: 07.58 07.14 PageListCache begin save key=72e4baac09490eff0e70bbc2765a1902
 66: 07.58 07.14 PageListCache end save
 67: 07.58 07.14 PageListSort begin
 68: 07.58 07.14 PageListSort sort
 69: 07.64 07.20 PageListSort end
 70: 07.64 07.20 MakePageList end
 71: 07.64 07.20 FPLTemplate: FPLTemplateSliceList
 72: 07.65 07.20 FPLTemplate: FPLTemplateFormat
 73: 07.67 07.23 MarkupToHTML begin
 74: 07.69 07.25 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 75: 07.70 07.26 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 76: 07.71 07.27 MarkupToHTML end
 77: 07.71 07.27 FPLTemplate: Chain end
 78: 07.71 07.27 MarkupToHTML end
 79: 07.71 07.27 MarkupToHTML begin
 80: 07.71 07.27 FPLTemplate: Chain begin
 81: 07.71 07.27 FPLTemplate: FPLTemplateLoad
 82: 07.71 07.27 FPLTemplate: FPLTemplateDefaults
 83: 07.71 07.27 FPLTemplate: FPLTemplatePageList
 84: 07.71 07.27 MakePageList pre
 85: 07.71 07.27 PageListSources begin
 86: 07.71 07.27 PageStore::ls begin wiki.d/{$FullName}
 87: 07.76 07.31 PageStore::ls merge wiki.d/{$FullName}
 88: 07.79 07.34 PageStore::ls end wiki.d/{$FullName}
 89: 07.80 07.35 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 90: 07.80 07.35 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 91: 07.80 07.35 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 92: 07.80 07.35 PageListSources end count=6
 93: 07.80 07.35 PageListTermsTargets begin count=6
 94: 07.80 07.35 PageIndexGrep begin
 95: 07.92 07.46 PageIndexGrep end
 96: 07.94 07.48 PageListTermsTargets end count=6
 97: 07.94 07.49 PageListSort pre ret=4 order=name
 98: 07.94 07.49 MakePageList items count=6, filters=PageListTermsTargets
 99: 08.00 07.49 MakePageList post count=6, readc=6
100: 08.00 07.49 PageListCache begin save key=01a6daa3e3a9cb65eb528c1bf1e3832f
101: 08.00 07.49 PageListCache end save
102: 08.00 07.49 PageListSort begin
103: 08.00 07.49 PageListSort sort
104: 08.00 07.49 PageListSort end
105: 08.00 07.49 MakePageList end
106: 08.00 07.49 FPLTemplate: FPLTemplateSliceList
107: 08.00 07.49 FPLTemplate: FPLTemplateFormat
108: 08.01 07.50 MarkupToHTML begin
109: 08.03 07.52 MarkupToHTML end
110: 08.03 07.52 FPLTemplate: Chain end
111: 08.03 07.52 MarkupToHTML end
112: 08.03 07.52 MarkupToHTML begin
113: 08.03 07.53 FPLTemplate: Chain begin
114: 08.03 07.53 FPLTemplate: FPLTemplateLoad
115: 08.03 07.53 FPLTemplate: FPLTemplateDefaults
116: 08.03 07.53 FPLTemplate: FPLTemplatePageList
117: 08.03 07.53 MakePageList pre
118: 08.04 07.53 PageListSources begin
119: 08.04 07.53 PageStore::ls begin wiki.d/{$FullName}
120: 08.08 07.56 PageStore::ls merge wiki.d/{$FullName}
121: 08.11 07.59 PageStore::ls end wiki.d/{$FullName}
122: 08.12 07.60 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
123: 08.12 07.60 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
124: 08.12 07.60 PageStore::ls end $FarmD/wikilib.d/{$FullName}
125: 08.12 07.60 PageListSources end count=6
126: 08.12 07.60 PageListTermsTargets begin count=6
127: 08.12 07.60 PageIndexGrep begin
128: 08.24 07.72 PageIndexGrep end
129: 08.26 07.74 PageListTermsTargets end count=6
130: 08.27 07.74 PageListSort pre ret=4 order=name
131: 08.27 07.74 MakePageList items count=6, filters=PageListTermsTargets
132: 08.27 07.75 MakePageList post count=6, readc=6
133: 08.27 07.75 PageListCache begin save key=3881cc183e179cba421676fc97b4f53a
134: 08.27 07.75 PageListCache end save
135: 08.27 07.75 PageListSort begin
136: 08.27 07.75 PageListSort sort
137: 08.27 07.75 PageListSort end
138: 08.27 07.75 MakePageList end
139: 08.27 07.75 FPLTemplate: FPLTemplateSliceList
140: 08.27 07.75 FPLTemplate: FPLTemplateFormat
141: 08.28 07.75 MarkupToHTML begin
142: 08.29 07.77 MarkupToHTML end
143: 08.29 07.77 FPLTemplate: Chain end
144: 08.29 07.77 MarkupToHTML end
145: 08.29 07.77 MarkupToHTML begin
146: 08.30 07.78 MarkupToHTML end
147: 08.30 07.78 MarkupToHTML begin
148: 08.30 07.78 MarkupToHTML end
149: 08.39 07.86 MarkupToHTML end
150: 08.40 07.88 MarkupToHTML begin
151: 08.44 07.92 MarkupToHTML end
152: 08.44 07.92 MarkupToHTML begin
153: 08.46 07.93 MarkupToHTML end
154: 08.46 07.94 now