[pmwiki-users] How to retrieve the value of a Page Text Variable {Group/PageName$:Var} from a cookbook ?
Patrick R. Michaud
pmichaud at pobox.com
Sat Nov 25 16:02:27 CST 2006
On Sat, Nov 25, 2006 at 10:41:43PM +0100, Christophe David wrote:
> You need to be very precise with what you feed it.
>
> Try something like:
>
> Thanks again for your help.
>
> I am trying to get this to work in a cookbook/recipe :
>
> if (PageTextVar("Site.MyRecipeConfigurationdata", "EnableSomething") ==
> "1")
> {
> ...
> }
> and I cannot get the condition to be true, while I can retrieve the value
> of EnableSomething in another page with the
> {Site/MyRecipeConfigurationdata$:EnableSomething} markup.
>
> Any clue would be appreciated...
It might not work from local/config.php, because the
$PageTextVarPatterns haven't been loaded yet (these
are normally loaded as part of the markup routines).
You might need to do:
include_once("$FarmD/scripts/stdmarkup.php");
before calling the PageTextVar() function.
Pm
More information about the pmwiki-users
mailing list