<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thanks for this awesomely comprehensive reply.<div><br></div><div>It seems to me that by setting $DefaultName it should then take priority over the default "default"name (i.e. $Group/$Group), and that this would be a reasonable expectation for a wiki admin that the "home page" of a group would be preferred if there was any disambiguation.</div><div><br></div><div>e.g.</div><div>if (empty ($DefaultName)) then # the default</div><div> $PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');</div><div>else # admin changed the 'home page'</div><div> $PagePathFmt = array(,'$1.{$DefaultName}','{$Group}.$1','$1.$1');</div><div>endif</div><div><br></div><div>Many years ago the decision set set $Defaultname (to 'HomePage') was made and its not reversible now</div><div><br></div><div>thanks very much</div><div><br></div><div>Simon</div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 20 Aug 2023 at 17:39, Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Short answer: You can try setting this to config.php:<br>
<br>
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');<br>
<br>
This will affect the "Name" link in the page header, as well as wiki <br>
links like [[Name/]], [[Name.]], [[Name]] from within the Name group, <br>
and [[Name]] from another group.<br>
<br>
Long answer:<br>
<br>
There is ambiguity when you have pages Name.Name, Name.HomePage, and/or <br>
Main.Name. When a link [[Name]] is encountered indeed PmWiki may use a <br>
process different from the one in the author's mind. Same for the "Name" <br>
link in the page header. Same for (:pagelist list=grouphomes:) and the <br>
recently added page variables {$GroupHomePage} and similar.<br>
<br>
To calculate the full page name in the case only "Name" (no group) is <br>
supplied, the array $PagePathFmt is used, and the first page that exists <br>
from that array is returned.<br>
<br>
This is the default:<br>
$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');<br>
<br>
When the string "Name" is derived from the URL, such as when the browser <br>
follows a group link from a page header, then {$Group} is <br>
{$DefaultGroup} (Main) and the URL works like when it was a link <br>
[[Name]] in the Main group.<br>
<br>
When you have a link [[Name]] in any group, it will process it according <br>
to $PagePathFmt. So it will first try CurrentGroup.Name, then Name.Name, <br>
then Name.HomePage, and whatever page first exists it will be returned.<br>
<br>
For links [[Name/]] or [[Name.]], it knows that "Name" is the group <br>
name, but then again if both Name.Name and Name.HomePage exist, it will <br>
use the order of $PagePathFmt.<br>
<br>
Note that a link [[Name]] in a page of the Name group would point to <br>
Name.Name if it exists (from '{$Group}.$1'), and the same link in <br>
another group may point to Name.HomePage.<br>
<br>
Also a link [[Name]] in a group different from Name/, and a link <br>
[[Name]] "included" in another group from the Name/ group (by <br>
(:include:) or a page text variable, or a sidebar) may link to different <br>
pages.<br>
<br>
We could add a separate array to process the string from the URL (in <br>
ResolvePageName) different from $PagePathFmt that processes links in <br>
pages, but I'm afraid then you may have unexpected results with <br>
[[Name/]] and [[Name.]] links.<br>
<br>
Alternatively, use Name.Name as the group homepages, and remove the <br>
pages Name.HomePage and Main.Name.<br>
<br>
Petko<br>
<br>
<br>
On 20/08/2023 04:09, Simon wrote:<br>
> In the PmWiki responsive skin there are the lines<br>
> <br>
> <!--PageTitleFmt--><br>
> <div id='wikititle'><br>
> <div class='pagegroup'><a<br>
> href='{$ScriptUrl}/{$Group}'>{$Group}</a> /</div><br>
> <h1 class='pagetitle'>{$Title}</h1><br>
> </div><br>
> <br>
> In my config.php I set<br>
> $DefaultName = 'HomePage';<br>
> <br>
> In my wiki I have two pages<br>
> <br>
> MyGroup.HomePage (the landing page for the group)<br>
> and<br>
> MyGroup.MyGroup<br>
> <br>
> Event though I have configured the default name to "HomePage" PmWiki<br>
> continues to send page references in the form (specifically in the<br>
> page title as shown above)<br>
> "MyGroup/ "<br>
> to "MyGroup/MyGroup" if the Page "MyGroup.MyGroup" exists, this<br>
> doesn't seem right<br>
> <br>
</blockquote></div>