2017-98-08-Deb: 2017-05-03-11-24-57: 2011-10-02: 2011-08-27: 2011-05-30: 2011-05-28: 2011-04-16: 2011-01-22: 2010-12-03-13-04-04: 2010-09-24: 2010-01-08: 2009-11-16: 2009-09-xx: 2008-01-25: 2007-09-28: 2007-04-21: 2007-04-13: 2006-12-01: 2006-09-22: 2006-09-06: 2006-04-20: 2006-03-XX: 2006-01-XX: 2006-01-28-04-57-02: 2005-09-23: 2005-08-12: 2005-01-24: 2004-09-24: 2004-05-13: 2003-12-08: 2003-04-04: 2002-02-22: 2002-01-25:
|
PmWiki /
PageTextVariablesPage text variables are string variables created in the wiki text of a page, and can be automatically made available for inclusion in other pages. Defining Page Text VariablesThere are three ways to define automated Page Text Variables:
This creates a new variable that can be accessed by {$:Name} (becomes: "Crisses") in the page.
This creates the {$:Address} variable (variable markup becomes: "1313 Mockingbird Lane") in the page.
This creates the {$:Country} variable (variable markup becomes: "Transylvania ") in the page.
UsageUsage on the same pageOn the same page you can resolve page text variables through the Usage in headers and footers: special referencesIf you want a GroupHeader, GroupFooter, SideBar, etc to call on page text variable in the main page, you need to include special reference information.
To explicitly reference the page text variable from the page being displayed add an asterisk to the page text variable's markup:
To include a page text variable from a header or footer see usage from other pages below. Special references also apply to page variables and page list templates.
Usage from other pagesIf you want to pull the data from another page, use the
Usage from included pagesPage text variables are never included from their source page. See Usage from other pages above to refer to a page text variable on another page. Usage with pagelistsPage lists can also access the page text variables:
And to create pagelist formats (such as those documented at Site.Page List Templates, Page Lists, Page List Templates, Page Variables. Store custom pagelists at Site.Local Templates). Page lists can also use page text variables to select pages :
lists pages having '$:City' set to 'Paris'.
'quotes' must surround all the selections.
Testing if set or not set
Tip :
Use page text variable in a templateDisplay pages by Audience page text variable.
Use page text variables in conditional markupPage text variables will be assigned/evaluated before any conditional markup is evaluated. This effectively means that you cannot declare a PTV within an if...else condition; and also that a PTV will have a value even if it is set within a Usage - from within code (developers only)The standard $var=PageVar($pagename,'$:City')
It works by caching all page (text) variables it finds in a page (in This page may have a more recent version on pmwiki.org : PmWiki:PageTextVariables , and a talk page: PmWiki:PageTextVariables-Talk . |