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:)
  • 01092: Markup expressions not properly parsed inside of if statements within searches
  • 00447: Distinguish !Page and Category.Page in backlinks
  • 01176: Suggesting to remove '!' as exclusion character
  • 01177: Add a mechanism to disable internal $acache
  • 01095: alternative link text in category markup
  • 01174: link|+ behavior changed when adding suffix, only on PmWiki.org
  • 01171: Recent notify posts for the PITS group should include Summary
  • 00972: Page text variable linking for Category (or other Groups)
  • 01175: Multi-line PmForm? fields stored with "\r"
  • 00477: Reminding Pm to Document Functions . . .

[[#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 26, 2006, at 02:32 AM
  0: 00.00 00.00 config start
  1: 00.02 00.00 config end
  2: 00.31 00.07 MarkupToHTML begin
  3: 00.33 00.07 MarkupToHTML begin
  4: 00.83 00.10 MarkupToHTML end
  5: 00.83 00.10 MarkupToHTML begin
  6: 00.87 00.10 MarkupToHTML end
  7: 00.87 00.10 MarkupToHTML begin
  8: 01.41 00.12 MarkupToHTML end
  9: 01.41 00.12 MarkupToHTML begin
 10: 01.43 00.13 MarkupToHTML end
 11: 01.43 00.13 MarkupToHTML begin
 12: 01.44 00.13 FPLTemplate: Chain begin
 13: 01.44 00.13 FPLTemplate: FPLTemplateLoad
 14: 01.44 00.13 FPLTemplate: FPLTemplateDefaults
 15: 01.44 00.13 FPLTemplate: FPLTemplatePageList
 16: 01.44 00.13 MakePageList pre
 17: 01.46 00.13 PageListSources begin
 18: 01.46 00.13 PageStore::ls begin wiki.d/{$FullName}
 19: 02.30 00.14 PageStore::ls merge wiki.d/{$FullName}
 20: 03.28 00.19 PageStore::ls end wiki.d/{$FullName}
 21: 03.31 00.20 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 22: 03.31 00.20 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 23: 03.31 00.20 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 24: 03.33 00.21 PageListSources end count=1413
 25: 03.34 00.21 PageListTermsTargets begin count=1413
 26: 03.34 00.21 PageIndexGrep begin
 27: 04.87 00.35 PageIndexGrep end
 28: 05.33 00.37 PageListTermsTargets end count=1216
 29: 05.35 00.38 PageListSort pre ret=4 order=name
 30: 05.35 00.38 MakePageList items count=1216, filters=PageListTermsTargets
 31: 11.88 01.13 MakePageList post count=1203, readc=1216
 32: 11.88 01.13 PageListCache begin save key=a496ecc0e7b5445354468efd35b044e9
 33: 11.89 01.13 PageListCache end save
 34: 11.89 01.13 PageListSort begin
 35: 11.89 01.13 PageListSort sort
 36: 12.15 01.22 PageListSort end
 37: 12.15 01.22 MakePageList end
 38: 12.16 01.23 FPLTemplate: FPLTemplateSliceList
 39: 12.17 01.23 FPLTemplate: FPLTemplateFormat
 40: 12.33 01.26 MarkupToHTML begin
 41: 12.40 01.29 MarkupToHTML end
 42: 12.40 01.29 FPLTemplate: Chain end
 43: 12.41 01.29 MarkupToHTML end
 44: 12.41 01.29 MarkupToHTML begin
 45: 12.41 01.29 FPLTemplate: Chain begin
 46: 12.41 01.29 FPLTemplate: FPLTemplateLoad
 47: 12.42 01.29 FPLTemplate: FPLTemplateDefaults
 48: 12.42 01.29 FPLTemplate: FPLTemplatePageList
 49: 12.42 01.29 MakePageList pre
 50: 12.42 01.29 PageListSources begin
 51: 12.43 01.29 PageStore::ls begin wiki.d/{$FullName}
 52: 12.74 01.30 PageStore::ls merge wiki.d/{$FullName}
 53: 12.89 01.34 PageStore::ls end wiki.d/{$FullName}
 54: 12.92 01.35 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 55: 12.92 01.35 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 56: 12.92 01.35 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 57: 12.94 01.36 PageListSources end count=1189
 58: 12.94 01.36 PageListTermsTargets begin count=1189
 59: 12.94 01.36 PageIndexGrep begin
 60: 13.35 01.49 PageIndexGrep end
 61: 13.40 01.50 PageListTermsTargets end count=1176
 62: 13.41 01.51 PageListSort pre ret=6 order=-time
 63: 13.41 01.51 MakePageList items count=1176, filters=PageListTermsTargets,PageListSort
 64: 15.25 02.01 MakePageList post count=1175, readc=1176
 65: 15.25 02.01 PageListCache begin save key=72e4baac09490eff0e70bbc2765a1902
 66: 15.26 02.01 PageListCache end save
 67: 15.26 02.01 PageListSort begin
 68: 15.26 02.01 PageListSort sort
 69: 15.46 02.08 PageListSort end
 70: 15.46 02.08 MakePageList end
 71: 15.48 02.09 FPLTemplate: FPLTemplateSliceList
 72: 15.48 02.09 FPLTemplate: FPLTemplateFormat
 73: 15.54 02.11 MarkupToHTML begin
 74: 15.62 02.14 MarkupToHTML end
 75: 15.62 02.14 FPLTemplate: Chain end
 76: 15.63 02.14 MarkupToHTML end
 77: 15.63 02.14 MarkupToHTML begin
 78: 15.63 02.14 FPLTemplate: Chain begin
 79: 15.63 02.14 FPLTemplate: FPLTemplateLoad
 80: 15.64 02.14 FPLTemplate: FPLTemplateDefaults
 81: 15.64 02.14 FPLTemplate: FPLTemplatePageList
 82: 15.64 02.14 MakePageList pre
 83: 15.64 02.14 PageListSources begin
 84: 15.64 02.14 PageStore::ls begin wiki.d/{$FullName}
 85: 15.99 02.15 PageStore::ls merge wiki.d/{$FullName}
 86: 16.13 02.19 PageStore::ls end wiki.d/{$FullName}
 87: 16.14 02.19 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 88: 16.15 02.19 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 89: 16.15 02.20 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 90: 16.15 02.20 PageListSources end count=6
 91: 16.15 02.20 PageListTermsTargets begin count=6
 92: 16.15 02.20 PageIndexGrep begin
 93: 16.60 02.34 PageIndexGrep end
 94: 16.74 02.36 PageListTermsTargets end count=6
 95: 16.76 02.37 PageListSort pre ret=4 order=name
 96: 16.76 02.37 MakePageList items count=6, filters=PageListTermsTargets
 97: 16.77 02.37 MakePageList post count=6, readc=6
 98: 16.77 02.37 PageListCache begin save key=01a6daa3e3a9cb65eb528c1bf1e3832f
 99: 16.77 02.37 PageListCache end save
100: 16.77 02.37 PageListSort begin
101: 16.77 02.37 PageListSort sort
102: 16.78 02.37 PageListSort end
103: 16.78 02.37 MakePageList end
104: 16.78 02.37 FPLTemplate: FPLTemplateSliceList
105: 16.78 02.37 FPLTemplate: FPLTemplateFormat
106: 16.80 02.38 MarkupToHTML begin
107: 16.87 02.40 MarkupToHTML end
108: 16.87 02.40 FPLTemplate: Chain end
109: 16.88 02.40 MarkupToHTML end
110: 16.88 02.40 MarkupToHTML begin
111: 16.89 02.40 FPLTemplate: Chain begin
112: 16.89 02.40 FPLTemplate: FPLTemplateLoad
113: 16.89 02.41 FPLTemplate: FPLTemplateDefaults
114: 16.89 02.41 FPLTemplate: FPLTemplatePageList
115: 16.89 02.41 MakePageList pre
116: 16.89 02.41 PageListSources begin
117: 16.89 02.41 PageStore::ls begin wiki.d/{$FullName}
118: 17.27 02.41 PageStore::ls merge wiki.d/{$FullName}
119: 17.36 02.45 PageStore::ls end wiki.d/{$FullName}
120: 17.36 02.46 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
121: 17.37 02.46 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
122: 17.37 02.46 PageStore::ls end $FarmD/wikilib.d/{$FullName}
123: 17.37 02.46 PageListSources end count=6
124: 17.37 02.46 PageListTermsTargets begin count=6
125: 17.37 02.46 PageIndexGrep begin
126: 17.60 02.60 PageIndexGrep end
127: 17.64 02.63 PageListTermsTargets end count=6
128: 17.65 02.63 PageListSort pre ret=4 order=name
129: 17.65 02.63 MakePageList items count=6, filters=PageListTermsTargets
130: 17.66 02.64 MakePageList post count=6, readc=6
131: 17.66 02.64 PageListCache begin save key=3881cc183e179cba421676fc97b4f53a
132: 17.66 02.64 PageListCache end save
133: 17.66 02.64 PageListSort begin
134: 17.66 02.64 PageListSort sort
135: 17.66 02.64 PageListSort end
136: 17.66 02.64 MakePageList end
137: 17.66 02.64 FPLTemplate: FPLTemplateSliceList
138: 17.66 02.64 FPLTemplate: FPLTemplateFormat
139: 17.66 02.64 MarkupToHTML begin
140: 17.69 02.66 MarkupToHTML end
141: 17.69 02.66 FPLTemplate: Chain end
142: 17.70 02.66 MarkupToHTML end
143: 17.70 02.66 MarkupToHTML begin
144: 17.71 02.67 MarkupToHTML end
145: 17.71 02.67 MarkupToHTML begin
146: 17.72 02.68 MarkupToHTML end
147: 17.84 02.76 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
148: 17.86 02.77 ReadApprovedUrls SiteAdmin.ApprovedUrls end
149: 17.92 02.81 MarkupToHTML end
150: 17.94 02.83 MarkupToHTML begin
151: 18.04 02.88 MarkupToHTML end
152: 18.04 02.88 MarkupToHTML begin
153: 18.06 02.90 MarkupToHTML end
154: 18.13 02.90 now