[pmwiki-users] PTV on default page

Petko Yotov 5ko at 5ko.fr
Sun Dec 30 21:18:00 CST 2012


V.Krishn writes:
> On default page (Main.HomePage)
> http://<domain>/wiki/pmwiki.php
> I have set a ptv (:test: text123:)
>
> I am unable to use the PTV from config.php
> i.e by using PageTextVar($pagename,'test');
> but on page http://<domain>/wiki/pmwiki.php?n=Main.HomePage
> it is available.

The first example, your $pagename variable is not yet defined. You can help  
PmWiki define it by adding this line near the end of config.php, and before  
your line:

  $pagename = ResolvePageName($pagename);

However, this should be done as late as possible in config.php, notably  
after defining $DefaultGroup, $DefaultPage and $DefaultName, and after  
anything related to passwords (authuser, $DefaultPasswords). When you  
request a page text variable, the full page and the GroupAttributes page are  
read according to known permissions, and some permissions are cached -- if  
you do this too early, PmWiki may cache the wrong permissions.

See the section "Order of the commands in config.php" :

  http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-order

Petko




More information about the pmwiki-users mailing list