01058: PTV defined and used on an included page do not render

Summary: PTV defined and used on an included page do not render
Created: 2008-11-25 16:41
Status: Closed - replied, inactive
Category: Bug
From: bwills?
Assigned:
Priority: 4
Version: 2.2.0-beta65
OS: RHEL ES 4.0/Apache 2.0.52/PHP 4.3.9

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:

  1. The page is likely to be included, justifying the effort to fully qualify the pagename/ptv.
  2. 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