01058: PTV defined and used on an included page do not render
Description: Page text variables defined and used on the same page do not render when that page is included by another page.
This could very well be an artifact of a partially implement feature. I do notice that PTV exist in this version of PmWiki but are not mentioned in the accompanying documentation. If this is not such an artifact, then the claim on http://www.pmwiki.org/wiki/PmWiki/PageTextVariables is incorrect: Usage from included pages: Page text variables are expanded relative to their source page, so they work as you would expect. .
Example:(:comment Included.Page:) PTV has a value in this context.\\ :PTV: I have value\\ PTV == "{$:PTV}" (:comment End Included.Page:) (:comment Including.Page:) PTV has no value in this context.\\ (:include Included.Page:) (:comment End Including.Page:)
The only way I can figure to work around this issue is to use the long form {Included/Page$:PTV}
, which requires the following assumptions:
- The page is likely to be included, justifying the effort to fully qualify the pagename/ptv.
- The page name will not change, since no form of
{$FullName}
or other substitutions works correctly in the including page context.
Hi. If I understand correctly, in Including.Page, you wish to display "I have value" set in Included.Page? Set to config.php this line:
$EnableRelativePageVars
= 1;
Then, it should work. {$:PTV}
should then display the variable in the physical page where it is written (Included.Page); and {*$:PTV}
should always display a variable defined in the current Including.Page, even if {*$:PTV}
is written in an included page or in a header/footer. --Petko May 07, 2009, at 10:59 PM