<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Petko Yotov wrote:
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">On Friday 03 April 2009 11:29:13 Ed W wrote:
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">Just letting you know that you can easily override the default trails.php
script like this :
* move your modified file from scripts/ to cookbook/
* add to config.php :
  $EnableWikiTrails = 0;
  include_once("$FarmD/cookbook/trails.php");
      </pre>
    </blockquote>
    <pre wrap="">Sure - that's exactly what I did to create the file I mailed

However, the new file should have identical functionality to before - it
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The point of using your modified file is that it provides functionality 
different from the default one, and you can upgrade to newer versions of 
PmWiki without losing that functionality.
  </pre>
</blockquote>
<br>
Right - and as I said - I *already* do this for exactly that reason.&nbsp;
However, hopefully it's a shortlived thing before the changes filter
upstream for the next release...&nbsp; (they are hardly controversial so I
hope you will have few problems including them)<br>
<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <blockquote type="cite">
    <pre wrap="">The main new functionality is that:
    </pre>
  </blockquote>
  <pre wrap=""><!---->[...]

As I said, I haven't yet had the chance to review the changes, and I'll need 
to find some time. In the meantime, you might add this feature request to 
PITS, so we don't lose track of it, and so we could estimate its popularity.
  </pre>
</blockquote>
<br>
OK, but the changes are so small you could probably actually review
them in less time than replying to this email. <br>
<br>
Essentially I broke the function up into two functions.&nbsp; The entry
point function simplifies to:<br>
<br>
<blockquote>function MakeTrailStop($pagename,$trailname) {<br>
&nbsp; $links = FindNextPrev($pagename,$trailname);<br>
&nbsp; $prev=$links['prevl'];<br>
&nbsp; $next=$links['nextl'];<br>
&nbsp; return "&lt;span class='wikitrail'&gt;&amp;lt;&amp;lt; $prev |
$trailname | $next &amp;gt;&amp;gt;&lt;/span&gt;";<br>
}<br>
</blockquote>
<br>
The new function is identical to the old, except it includes these
extra lines (in two places, slightly different for the $next)<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Skim forward looking for next link in the same sub-tree level<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($j=$i+1;$j&lt;count($t);$j++) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($t[$j]['parent'] == $t[$i]['parent']) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $results['nextl'] = $t[$j]['markup'];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!$t[$j]['parent']) break; // optimisation - bailout if we
hit top level<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
So the logic is simply to look for another element which has the same
parent as this element<br>
<br>
This new code is not used in the current wiki, but it makes it simple
to use it.&nbsp; Here is my implementation:<br>
<br>
<blockquote>// Our customised version<br>
function MakeTrailStopMaS($pagename,$trailname) {<br>
&nbsp; $links = FindNextPrev($pagename,$trailname);<br>
&nbsp; $prev=$links['prevl'];<br>
&nbsp; $next=$links['nextl'];<br>
&nbsp; if ($prev) $prev = '&amp;lt;&amp;lt; '.$prev;<br>
&nbsp; if ($next) $next = $next.' &amp;gt;&amp;gt;';<br>
&nbsp; if ($next || $prev) {<br>
&nbsp;&nbsp;&nbsp; return "&lt;span class='wikitrail'&gt;&lt;span
class='prev'&gt;$prev&lt;/span&gt; | &lt;span
class='next'&gt;$next&lt;/span&gt;&lt;/span&gt;";<br>
&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp; return "";<br>
&nbsp; }<br>
}<br>
</blockquote>
<br>
Note my implementation always has a span, it can be styled to have the
arrows inside the next/prev links using CSS, it also check that there
is either a prev or next link to avoid leaving a dangling "|" on it's
own<br>
<br>
I didn't change any of this in the current implementation, however, I
think it would be good to put on the todo list...<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">Change the default trail separator to something more standard, eg "&raquo;"
(it looks like &gt;&gt; for those viewing in plain text):
    SDV($TrailPathSep, ' &amp;raquo; ');
        </pre>
      </blockquote>
      <pre wrap="">I disagree. Guillemets (angle quotes, &amp;raquo;) are indicators for quoted
speech. We should use arrows (&amp;rarr;) if we want to indicate arrows. :-)
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/%E2%86%92">http://en.wikipedia.org/wiki/%E2%86%92</a>
      </pre>
    </blockquote>
    <pre wrap="">I disagree your disagree...

Wikipedia agrees that they are "sometimes used to indicate direction" -
however, I acknowledge that I had not realised that were used for quoted
speech (just an ignorant english speaker I guess...)

A quick search of the internet suggests that for english speaking
websites the character I suggested is very popular and certainly way
more popular than the "pipe" character.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
What is popular is not always right. If a quick search of the internet 
suggested that "invalid" HTML is "very popular and certainly way more popular" 
than "valid" HTML, I wouldn't argue for a core change in that direction.
  </pre>
</blockquote>
<br>
I think you are being deliberately obstruse.&nbsp; I'm not suggesting
anything "invalid" is useful.&nbsp; <br>
<br>
The current pipe character is suboptimal in my opinion.&nbsp; Some kind of
arrow would be an improvement.&nbsp; Whilst the raquo may not be perfect it
seems like a good choice without going for a graphic.&nbsp; After all the
"&gt;" greater than sign has other meanings in english and yet most
people have no confusion when it's used also as an arrow - I am not a
french speaker, but I doubt a symbol which looks like a small
"&gt;&gt;" and is widely (incorrectly) used as a graphic on major
websites will cause too much confusion in general <br>
<br>
Prepared to be wrong, but in any case, some kind of arrow seems a lot
better than a pipe character. <br>
<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">
Jacob Nielsen, an expert in web usability, recommends using "&gt;" although his 
own site uses an arrow (.GIF picture).
  <a class="moz-txt-link-freetext" href="http://www.useit.com/alertbox/breadcrumbs.html">http://www.useit.com/alertbox/breadcrumbs.html</a>
  </pre>
</blockquote>
<br>
Personally I don't like his arrow, I tend to agree with his words that
"&gt;" is nicer...<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">BTW, our ^|breadcrumbs|^ implementation violates the rule not to have links to 
the current page (selflinks).
  </pre>
</blockquote>
<br>
Agreed - this is part of what makes me think this was an accidental
mis-implementation that was intended to be improved later?&nbsp; Original
author here to comment?<br>
<br>
Untested, but you could ammend my function FindPrevNext to include the
parent in the results:<br>
<br>
Change:<br>
<br>
&nbsp;&nbsp;&nbsp; if ($t[$i]['pagename']==$pagename) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Found our page<br>
<br>
To:<br>
<br>
&nbsp;&nbsp;&nbsp; if ($t[$i]['pagename']==$pagename) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Found our page<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($t[$i]['parent']) $results['parent'] = $t[ $t[$i]['parent']
]['markup']'<br>
<br>
This would then give you the option to use the "parent" markup as the
center of the breadcrumb.<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">I agree that this could be improved -- and should be, without breaking 
existing wikis upon an upgrade.
  </pre>
</blockquote>
<br>
My changes merely give the wiki author the option to make these changes
- the current implementation should be identical to the old<br>
<br>
That said I personally (separately) recommend that we DO break existing
wikis with these sensible changes to the separator and wrapping in a
span...<br>
<br>
<blockquote cite="mid:200904041837.34301.5ko@5ko.fr" type="cite">
  <pre wrap="">Arrows or "&gt;" are fine with me; I'd use "&gt;" for better compatibility with 
(all) browsers. But yet, should we change a default setting if some existing 
sites may rely on it? Generally, PmWiki doesn't do this.
  </pre>
</blockquote>
<br>
Backwards compatibility is only needed up to a point.&nbsp; In this case
don't have strong feeling because it doesn't affect my wiki.&nbsp; However,
I would recommend the span tag change since it's low impact.&nbsp; The
change in pipe to arrow is a "good thing" (tm) in my opinion, but
obviously larger impact.<br>
<br>
<br>
Good luck<br>
<br>
Ed W<br>
</body>
</html>