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:)
  • 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
  • 01052: SectionEdit? mishandles ==== inside preformat markup ([@@])
  • 00980: $HTMLHeaderFmt['utf-8'] declared but not 'global'-ed in xlpage-utf-8.php

[[#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.08 00.07 MarkupToHTML begin
 3: 00.08 00.07 MarkupToHTML begin
 4: 00.09 00.08 MarkupToHTML end
 5: 00.09 00.08 MarkupToHTML begin
 6: 00.09 00.09 MarkupToHTML end
 7: 00.09 00.09 MarkupToHTML begin
 8: 00.10 00.10 MarkupToHTML end
 9: 00.10 00.10 MarkupToHTML begin
10: 00.11 00.10 MarkupToHTML end
11: 00.11 00.10 MarkupToHTML begin
12: 00.11 00.10 FPLTemplate begin
13: 00.11 00.11 MakePageList pre
14: 00.11 00.11 PageListCache begin load key=a496ecc0e7b5445354468efd35b044e9
15: 00.11 00.11 PageListCache end load
16: 00.11 00.11 PageListSources begin
17: 00.11 00.11 PageListSources end count=848
18: 00.11 00.11 PageListSort pre ret=4 order=name
19: 00.11 00.11 MakePageList items count=848, filters=
20: 00.13 00.12 MakePageList post count=848, readc=0
21: 00.13 00.12 PageListSort begin
22: 00.13 00.12 PageListSort sort
23: 00.17 00.17 PageListSort end
24: 00.17 00.17 MakePageList end
25: 00.21 00.20 MarkupToHTML begin
26: 00.22 00.21 MarkupToHTML end
27: 00.22 00.21 FPLTemplate end
28: 00.23 00.22 MarkupToHTML end
29: 00.23 00.22 MarkupToHTML begin
30: 00.23 00.22 FPLTemplate begin
31: 00.23 00.22 MakePageList pre
32: 00.23 00.22 PageListCache begin load key=72e4baac09490eff0e70bbc2765a1902
33: 00.23 00.22 PageListCache end load
34: 00.23 00.22 PageListSources begin
35: 00.23 00.22 PageListSources end count=1052
36: 00.23 00.22 PageListSort pre ret=6 order=-time
37: 00.23 00.22 MakePageList items count=1052, filters=PageListSort
38: 00.67 00.59 MakePageList post count=1052, readc=1052
39: 00.67 00.59 PageListSort begin
40: 00.67 00.59 PageListSort sort
41: 00.73 00.65 PageListSort end
42: 00.73 00.65 MakePageList end
43: 00.76 00.68 MarkupToHTML begin
44: 00.84 00.75 MarkupToHTML end
45: 00.84 00.75 FPLTemplate end
46: 00.84 00.75 MarkupToHTML end
47: 00.84 00.75 MarkupToHTML begin
48: 00.84 00.76 FPLTemplate begin
49: 00.84 00.76 MakePageList pre
50: 00.84 00.76 PageListCache begin load key=01a6daa3e3a9cb65eb528c1bf1e3832f
51: 00.84 00.76 PageListCache end load
52: 00.84 00.76 PageListSources begin
53: 00.84 00.76 PageListSources end count=6
54: 00.84 00.76 PageListSort pre ret=4 order=name
55: 00.84 00.76 MakePageList items count=6, filters=
56: 00.84 00.76 MakePageList post count=6, readc=0
57: 00.84 00.76 PageListSort begin
58: 00.84 00.76 PageListSort sort
59: 00.84 00.76 PageListSort end
60: 00.84 00.76 MakePageList end
61: 00.85 00.77 MarkupToHTML begin
62: 00.87 00.78 MarkupToHTML end
63: 00.87 00.78 FPLTemplate end
64: 00.87 00.79 MarkupToHTML end
65: 00.87 00.79 MarkupToHTML begin
66: 00.87 00.79 FPLTemplate begin
67: 00.87 00.79 MakePageList pre
68: 00.87 00.79 PageListCache begin load key=3881cc183e179cba421676fc97b4f53a
69: 00.87 00.79 PageListCache end load
70: 00.87 00.79 PageListSources begin
71: 00.87 00.79 PageListSources end count=6
72: 00.87 00.79 PageListSort pre ret=4 order=name
73: 00.87 00.79 MakePageList items count=6, filters=
74: 00.87 00.79 MakePageList post count=6, readc=0
75: 00.87 00.79 PageListSort begin
76: 00.87 00.79 PageListSort sort
77: 00.88 00.79 PageListSort end
78: 00.88 00.79 MakePageList end
79: 00.88 00.79 MarkupToHTML begin
80: 00.90 00.81 MarkupToHTML end
81: 00.90 00.81 FPLTemplate end
82: 00.90 00.81 MarkupToHTML end
83: 00.90 00.81 MarkupToHTML begin
84: 00.90 00.82 MarkupToHTML end
85: 00.91 00.82 MarkupToHTML begin
86: 00.91 00.82 MarkupToHTML end
87: 00.98 00.89 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
88: 00.98 00.90 ReadApprovedUrls SiteAdmin.ApprovedUrls end
89: 01.01 00.92 MarkupToHTML end
90: 01.03 00.94 MarkupToHTML begin
91: 01.07 00.98 MarkupToHTML end
92: 01.08 00.98 MarkupToHTML begin
93: 01.09 01.00 MarkupToHTML end
94: 01.19 01.00 now