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:)
  • AbbreviationPlurals: Automatically format text like CCDs as a plural abbreviation, instead of as a wikiword.
  • ABCHoverIndex: displays a pagelist as an alphabetic hover menu, sorted by title
  • AbcMusic: Display music scores from abc notation
  • ActionLog: Maintain a page log of wiki actions
  • AddDeleteLine: Create a list where entries can easily be inserted and deleted
  • AddDeleteLine2: An easy way to add information to a page and delete it again.
  • AddImageType: Add new image type extension
  • AddLinkBookmarklet: How to use PmWiki to bookmark pages
  • AddNewline: Make wiki text end with a newline character, so the last line won't be marked as changed if text is added at the bottom
  • AddPageForm: How to add new pages without creating a link first
(:pagelist fmt=#summary group=PITS "Summary:" count=10 order=-time:)
  • 00407: wikitrails fails cross-group
  • 01058: PTV defined and used on an included page do not render
  • 00243: spamming of the pages
  • 00028: Turn PmWiki into a full-fledged blogging tool
  • 01057: Save fails (content destroyed) due to filled quota
  • 01056: LDAP Authentication doesn't work with french accented characters
  • 01055: Slight tweak to sample-config.php include_once lines for farm use
  • 01054: install fails on IIS7?
  • 00903: intermittent broken links with umlauts
  • 01053: Pagelist doesn't show words containing accentuated letters in alphabetical order

[[#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.00 00.00 config end
  2: 00.10 00.07 MarkupToHTML begin
  3: 00.10 00.08 MarkupToHTML begin
  4: 00.11 00.08 MarkupToHTML end
  5: 00.11 00.08 MarkupToHTML begin
  6: 00.11 00.09 MarkupToHTML end
  7: 00.11 00.09 MarkupToHTML begin
  8: 00.12 00.10 MarkupToHTML end
  9: 00.12 00.10 MarkupToHTML begin
 10: 00.13 00.11 MarkupToHTML end
 11: 00.13 00.11 MarkupToHTML begin
 12: 00.13 00.11 FPLTemplate begin
 13: 00.13 00.11 MakePageList pre
 14: 00.16 00.11 PageListSources begin
 15: 00.16 00.11 PageStore::ls begin wiki.d/{$FullName}
 16: 00.25 00.13 PageStore::ls merge wiki.d/{$FullName}
 17: 00.28 00.17 PageStore::ls end wiki.d/{$FullName}
 18: 00.29 00.17 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 19: 00.29 00.17 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 20: 00.29 00.17 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 21: 00.29 00.17 PageListSources end count=1048
 22: 00.29 00.17 PageListTermsTargets begin count=1048
 23: 00.30 00.17 PageIndexGrep begin
 24: 00.40 00.27 PageIndexGrep end
 25: 00.42 00.29 PageListTermsTargets end count=865
 26: 00.42 00.29 PageListSort pre ret=4 order=name
 27: 00.43 00.29 MakePageList items count=865, filters=PageListTermsTargets
 28: 00.90 00.70 MakePageList post count=852, readc=865
 29: 00.90 00.70 PageListCache begin save key=a496ecc0e7b5445354468efd35b044e9
 30: 00.90 00.70 PageListCache end save
 31: 00.90 00.70 PageListSort begin
 32: 00.90 00.70 PageListSort sort
 33: 00.95 00.75 PageListSort end
 34: 00.95 00.75 MakePageList end
 35: 00.98 00.78 MarkupToHTML begin
 36: 01.00 00.80 MarkupToHTML end
 37: 01.00 00.80 FPLTemplate end
 38: 01.00 00.80 MarkupToHTML end
 39: 01.00 00.80 MarkupToHTML begin
 40: 01.00 00.80 FPLTemplate begin
 41: 01.00 00.80 MakePageList pre
 42: 01.02 00.80 PageListSources begin
 43: 01.02 00.80 PageStore::ls begin wiki.d/{$FullName}
 44: 01.09 00.83 PageStore::ls merge wiki.d/{$FullName}
 45: 01.12 00.86 PageStore::ls end wiki.d/{$FullName}
 46: 01.13 00.87 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 47: 01.13 00.87 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 48: 01.13 00.87 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 49: 01.13 00.87 PageListSources end count=1068
 50: 01.14 00.87 PageListTermsTargets begin count=1068
 51: 01.14 00.87 PageIndexGrep begin
 52: 01.24 00.97 PageIndexGrep end
 53: 01.26 00.99 PageListTermsTargets end count=1053
 54: 01.27 00.99 PageListSort pre ret=6 order=-time
 55: 01.27 00.99 MakePageList items count=1053, filters=PageListTermsTargets,PageListSort
 56: 01.74 01.40 MakePageList post count=1052, readc=1053
 57: 01.74 01.40 PageListCache begin save key=72e4baac09490eff0e70bbc2765a1902
 58: 01.74 01.40 PageListCache end save
 59: 01.74 01.40 PageListSort begin
 60: 01.74 01.40 PageListSort sort
 61: 01.81 01.47 PageListSort end
 62: 01.81 01.47 MakePageList end
 63: 01.83 01.49 MarkupToHTML begin
 64: 01.85 01.51 MarkupToHTML end
 65: 01.85 01.51 FPLTemplate end
 66: 01.86 01.51 MarkupToHTML end
 67: 01.86 01.51 MarkupToHTML begin
 68: 01.86 01.51 FPLTemplate begin
 69: 01.86 01.51 MakePageList pre
 70: 01.89 01.52 PageListSources begin
 71: 01.89 01.52 PageStore::ls begin wiki.d/{$FullName}
 72: 01.94 01.54 PageStore::ls merge wiki.d/{$FullName}
 73: 01.97 01.57 PageStore::ls end wiki.d/{$FullName}
 74: 01.98 01.57 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
 75: 01.98 01.58 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
 76: 01.98 01.58 PageStore::ls end $FarmD/wikilib.d/{$FullName}
 77: 01.98 01.58 PageListSources end count=6
 78: 01.98 01.58 PageListTermsTargets begin count=6
 79: 01.98 01.58 PageIndexGrep begin
 80: 02.10 01.68 PageIndexGrep end
 81: 02.12 01.70 PageListTermsTargets end count=6
 82: 02.12 01.71 PageListSort pre ret=4 order=name
 83: 02.12 01.71 MakePageList items count=6, filters=PageListTermsTargets
 84: 02.12 01.71 MakePageList post count=6, readc=6
 85: 02.12 01.71 PageListCache begin save key=01a6daa3e3a9cb65eb528c1bf1e3832f
 86: 02.12 01.71 PageListCache end save
 87: 02.12 01.71 PageListSort begin
 88: 02.12 01.71 PageListSort sort
 89: 02.12 01.71 PageListSort end
 90: 02.12 01.71 MakePageList end
 91: 02.13 01.72 MarkupToHTML begin
 92: 02.15 01.74 MarkupToHTML end
 93: 02.15 01.74 FPLTemplate end
 94: 02.15 01.74 MarkupToHTML end
 95: 02.15 01.74 MarkupToHTML begin
 96: 02.15 01.74 FPLTemplate begin
 97: 02.16 01.74 MakePageList pre
 98: 02.16 01.74 PageListSources begin
 99: 02.16 01.74 PageStore::ls begin wiki.d/{$FullName}
100: 02.21 01.77 PageStore::ls merge wiki.d/{$FullName}
101: 02.23 01.79 PageStore::ls end wiki.d/{$FullName}
102: 02.24 01.80 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
103: 02.24 01.80 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
104: 02.24 01.80 PageStore::ls end $FarmD/wikilib.d/{$FullName}
105: 02.24 01.80 PageListSources end count=6
106: 02.24 01.80 PageListTermsTargets begin count=6
107: 02.24 01.80 PageIndexGrep begin
108: 02.37 01.92 PageIndexGrep end
109: 02.39 01.94 PageListTermsTargets end count=6
110: 02.39 01.94 PageListSort pre ret=4 order=name
111: 02.39 01.94 MakePageList items count=6, filters=PageListTermsTargets
112: 02.39 01.94 MakePageList post count=6, readc=6
113: 02.39 01.94 PageListCache begin save key=3881cc183e179cba421676fc97b4f53a
114: 02.39 01.94 PageListCache end save
115: 02.39 01.94 PageListSort begin
116: 02.39 01.94 PageListSort sort
117: 02.39 01.94 PageListSort end
118: 02.39 01.94 MakePageList end
119: 02.40 01.95 MarkupToHTML begin
120: 02.42 01.97 MarkupToHTML end
121: 02.42 01.97 FPLTemplate end
122: 02.42 01.97 MarkupToHTML end
123: 02.42 01.97 MarkupToHTML begin
124: 02.43 01.97 MarkupToHTML end
125: 02.43 01.97 MarkupToHTML begin
126: 02.43 01.98 MarkupToHTML end
127: 02.49 02.04 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
128: 02.50 02.05 ReadApprovedUrls SiteAdmin.ApprovedUrls end
129: 02.53 02.07 MarkupToHTML end
130: 02.55 02.09 MarkupToHTML begin
131: 02.59 02.13 MarkupToHTML end
132: 02.59 02.13 MarkupToHTML begin
133: 02.60 02.15 MarkupToHTML end
134: 02.68 02.15 now