[pmwiki-users] Wikigroup - naming (& getting) the indicated homepage

Donald Z. Osborn dzosborn at gmail.com
Wed Jan 3 18:14:15 CST 2007


Thanks, Patrick,  for this the last one seems to work - i.e., so far, so
good (basically I have some HomePage's and some Accueil's and likely others.

The second to last - the redirect - also worked, but from
ML-L10n.ML-L10n.php (didn't see the ML-L10n.HomePage.php at all). It was
clunky however, with a one-second display of two error messages before
loading the redirect page (I screenshot the messages, but then went on to
the last suggestion).

THe other suggestion did not work for me.

Anyway, this is helpful and keeps us with a predictable model that clicking
on the logo (in these cases, flags) takes you to the HomePage in whatever
working language. (Well, almost whatever language, but let me get the simple
ones done first)

Don



On 1/3/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>
> On Wed, Jan 03, 2007 at 02:56:45PM -0500, Donald Z. Osborn wrote:
> >    In a wikigroup config, if I set $Name = 'Something'; and then go to
> >    www.althatstuffintheURL/wikigroup , then shouldn't there be an
> automatic
> >    redirect to www.althatstuffintheURL/wikigroup/Something ?
>
> Nope.  PmWiki doesn't load per-group or per-page configurations
> until after it's resolved the pagename.  So, by the time the
> wikigroup configuration is loaded, PmWiki has already decided
> on the correct pagename.
>
> Also, there is no $Name global variable to set (at least,
> PmWiki doesn't use one).  There is the {$Name} page variable,
> which returns the name (sans any group) of some page, but
> there's not a corresponding PHP variable.
>
> For what you're wanting to do, I suspect you want to set
> the $DefaultName variable, and this should be done relatively
> early in the config.php.  If you're wanting to change $DefaultName
> only for a particular group, you'll probably need to do something
> like...:
>
>     if (preg_match('!^NG-L10n[./]!', $pagename))
>       $DefaultName = 'Accueil';
>
> Another option is to simply put a redirect on the HomePage
> that goes to the desired page -- i.e., in local/NG-L10n.HomePage.php,
> put:
>
>     <?php
>       Redirect('NG-L10n.Accueil');
>
> >    Accueil is set as the homepage in the latter. Is it maybe not
> possible to
> >    have something other than HomePage retrieved automatically?
>
> It's possible to change the default page on a site-wide basis,
> but there's not really an easy way to do it only for certain
> groups.
>
> Although, come to think of it, another useful possibility would
> be to modify PmWiki's page search order, by doing something like:
>
>    $PagePathFmt = array(
>       '{$Group}.$1', '$1.$1', '$1.Accueil', '$1.{$DefaultName}');
>
> Then, when PmWiki is given only a partial page name (such as 'NG-L10n'),
> it will look for both *.Accueil and *.HomePage and
> use whichever one it finds.  Again, this setting won't work
> in a per-group customization (because PmWiki has to figure out
> the full group and page name in order to know which customizations
> to load), so it has to be done in local/config.php.  Ideally it
> should be near the very beginning of local/config.php .
>
> Pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20070103/ee160c08/attachment.html 


More information about the pmwiki-users mailing list