[pmwiki-users] Page variable limitations
Patrick R. Michaud
pmichaud at pobox.com
Thu Aug 24 15:44:36 CDT 2006
On Thu, Aug 24, 2006 at 04:17:59PM -0400, The Editor wrote:
> I have a long outstanding question on the mail list I really need help
> with. I've been trying to understand the limitations of Page
> Variable's in terms of the content that can be assigned them. Right
> now (I thought I had this fixed but maybe not) I am setting page
> variables using this line:
>
> $FmtPV["$$dv[0]"] = stripslashes("$dv[1]");
>
> I've also tried:
>
> $FmtPV["$$dv[0]"] = "$dv[1]";
>
> I know the page variable names and values are correct going into this
> line. The problem is if $dv[x] = "Two words", the page variable comes
> to an end at the space, meaning in my page {$Whatever} returns "Two",
> not "Two words".
>
> Is this a feature or a problem? Any input on the solution? This is a
> BIG irritation in the FAST Data project. Thanks in advance, again...
The problem is almost certainly not in the $FmtPV array itself,
but in whatever is handling the resulting value of {$Whatever}
that is splitting on spaces.
For example, if you're wanting to pass {$Whatever} to the value=
parameter of (:input:), and {$Whatever} contains multiple words,
you would need to do:
(:input text name=abc value="{$Whatever}" :)
so that after the page variable substitution PmWiki sees
(:input text name=abc value="Two words":)
and not
(:input text name=abc value=Two words:)
which is treated as
(:input text name="abc" value="Two" words:)
Pm
More information about the pmwiki-users
mailing list