Bonveno che la hempagino dil grupo di Berlina Idisti |
|
Weitere Domains / Plusa Situi
verschiedene Texte / diversa texti
Wiki interna Impressum:Inhaber der Internetpräsenz www.idoamiki.berlin.idolinguo.de: Inhaber der Internetpräsenz www.ido.berlin: |
PageTextVariablesPage Text Variables were introduced in 2.2.0 beta 2. These are string variables automatically made available through natural page markup or explicitly with page directive markup within the wiki text of the page.
Page text variables don't honor (:if:) . This is the same way that doing (:include OtherPage#section:) doesn't look to see if [[#section]] is inside of an (:if:)...(:ifend:) construct of some sort.
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 footersIf you want a GroupHeader, GroupFooter, SideBar, etc to call on page text variable in the main page, you need to include 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. 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. Nested page text variablesPage text variables can be nested
Another way you may nest PTVs is to make (part of) the variable name a variable in itself:
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 '$:Category' set to 'Feature'.
lists pages having a '$:Version' of '1' or '2'.
'quotes' must surround all the selections.
City variable is set.
Testing if set or not set
Use page text variable in a templateDisplay pages by Country page text variable.
some parts of this example are not working correctly, should not display all pages
Usage - otherData relevant to a page (the "Base" page) may now also be found in other groups. If the Base page is Main/HomePage, the data page could be Data-Main/HomePage. A new variable called $BaseName, which automatically calculates the Base page name from the Data page name, and can be defined by including the following in config.php: // The pattern for figuring out the basename of a page $BaseNamePatterns['/^Data-/'] = ''; Your pattern may vary. Usage - from within code (developers only)The standard $var=PageVar($pagename,'$:City')
Actually, for text variables, $var=PageTextVar($pagename,'City')
It works by caching all page text-variables it finds in a page (in
SDVA($PageTextVarPatterns, array( 'var:' => '/^:*\\s*(\\w[-\\w]*)\\s*:[ \\t]?(.*)$/m', '(:var:...:)' => '/\\(: *(\\w[-\\w]*) *:(?!\\))\\s?(.*?):\\)/s'));
This page may have a more recent version on pmwiki.org: PmWiki:PageTextVariables, and a talk page: PmWiki:PageTextVariables-Talk. |