|
Cookbook /
SetPageTextVariableSummary: Set PageTextVariables in config.php
Version: 1.0
Prerequisites: none
Status: Working
Maintainer: GNUZoo
Categories: PageVariables
Downloads: SetPageTextVariable.phpΔ
Questions answered by this recipe
DescriptionSet a PageTextVariable in config.php Currently you can read a PageTextVariable using the PageTextVar(). This recipe allows you to also set a PageTextVariable. Syntax:
SetPageTextVariable($pagename, $ptv, $val);
In the example above the $pagename variable would have a value like "Main.MyDataPage", the $ptv would be the name of a PageTextVariable, and $val would be the value to set it to. WARNING: If you change a PageTextVariable that is currently being viewed you should restart the page using the redirect function to the same page. For example, if you are viewing page "Main.MyDataPage" and your code sets PageTextVariables, at the very end of the code you would have the line Redirect("Main.MyDataPage"); InstallingCopy SetPageTextVariable.phpΔ to your cookbook directory In your config.php enter: include_once("cookbook/SetPageTextVariable .php");
or in your farmconfig.php enter: include_once(" $FarmD/cookbook/SetPageTextVariable .php");
NotesRelease NotesThis program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License, or (at your option) any later version. Copyright 2007 by GNUZoo (guru@gnuzoo.org) Please donate to the author at url: http://gnuzoo.org/GNUZooPayPal
CommentsSee AlsoPTVReplace Add link markup or input forms to replace values in PTVs Contributors |