[pmwiki-users] Category.Categories ?

Donald Z. Osborn dzosborn at gmail.com
Mon Nov 23 07:55:26 CST 2015

Thanks Pete,

Your grasp of this is much better than mine, so I appreciate your exploring
how to resolve it.

Just to see, I changed "Categories" to "HomePage" in Category.php (group
config), since that is what I used successfully for other groups, but this
did not change the behavior.

I use the autocreate code in config.php - per
http://www.pmwiki.org/wiki/PmWiki/Categories (scroll to page end). Doesn't
look like this would impact default home page, from whatever I can tell.
Maybe something else in the way categories are handled in the software?

All the best,


On Mon, Nov 23, 2015 at 4:20 AM, Peter Bowers <pbowers at pobox.com> wrote:

> On Sun, Nov 22, 2015 at 6:55 PM, Donald Z. Osborn <dzosborn at gmail.com>
> wrote:
>> Experimenting with categories, and seems to be going well, but wanted to
>> set the default page as Category.Categories rather than Category.Category
>> or Category.HomePage. Did a group config file Category.php including the
>> following lines but the site still wants to call Catagory.Category. Not the
>> first group config I've done so thought it would be simple.
> In http://www.pmwiki.org/wiki/PmWiki/BasicVariables#DefaultPage the
> definition of $DefaultPage makes specific reference to the importance of
> setting these variables (including $DefaultName) before any call to
> ResolvePageName() - presumably because it gets cached there.
> If you look at pmwiki.php it first calls farmconfig, then config, then
> scripts/stdconfig which calls ResolvePageName and then calls scripts/pgcust
> which handles any per-group or per-page customization. Thus ResolvePageName
> is always called before any per-page or per-group customization.
> Since you are already putting a conditional regarding the group name
> (which wouldn't be necessary if you were to keep it in the group
> customization file), why don't you put this part (setting of $DefaultName)
> in config.php instead of in the per-group customization script?
> Do note that the conditional as you have it will not respond if someone
> has specified just "Category" as the groupname (since there is no period or
> slash coming after it). You might want to consider something like this:
> if (preg_match('!^GroupTest(?:[./]|$)!', $pagename))
>  $DefaultName = 'Xyz';
> Hmmm... Even after I do this I find that MakePageName() is forcing the
> pagename to be GroupTest.GroupTest instead of GroupTest.Xyz. Shouldn't it
> be paying attention to the $DefaultName? I find this true regardless of
> whether I go to a url (?n=GroupTest or ?n=GroupTest.) or if I use an
> in-markup link ([[GroupTest.]]). Is this something I should put in PITS or
> am I not understanding how default group names are supposed to work or is
> something messed up in my system?
> Regardless, hopefully this has peeled a couple layers of the onion away
> from the problem.
> -Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20151123/772a6da8/attachment.html>

More information about the pmwiki-users mailing list