Extension talk:PageTrail

Enable PageTrail globally
I wanted to enable PageTrail globally for a whole wiki, but I didn't find some means provided already by PageTrail to do this. Is there something that I missed? My solution was to edit the PageTrail.body.php so that there is now

22                global $wgUser, $wgPageTrailGlobalEnable; 23 24                 if($wgPageTrailGlobalEnable) $this->enable = true; 25                else $this->enable = $wgUser->getOption('page_trail') != 0; instead of 22                global $wgUser; 23 24                 $this->enable = $wgUser->getOption('page_trail') != 0;

so one can globally enable PageTrail by setting

$wgPageTrailGlobalEnable = true;

in the LocalSettings.php

If there is not yet another means to do that already provided by PageTrails, I would suggest to implement this as a standard feature (if there is no other reason not to do so).

best regards, --Bin!johnny 19:01, 14 March 2008 (UTC)

hi bin!johnny / jean-lou,

I agree that enabling PageTrail by default is a great idea. However, if $wgPageTrailGlobalEnable is set, users won't be able to turn Pagetrail off for themselves ... It is either: Both solution are not optimal, as far as i'm concerned. What about an opt-out solution? Like this:
 * having PageTrail enabled globally and disallowing the users to turn it off xor
 * using jean-lou's default solution: users need to enable PageTrail explicitly in theier preferences.
 * PageTrail is enabled by default and
 * users will be able to turn it off if they don't want to use it

To implement this, I changed 22                global $wgUser; 23 24                 $this->enable = $wgUser->getOption('page_trail') != 0; in PageTrail.body.php to 22                global $wgUser, $wgPageTrailGlobalEnable; 23                $this->enable = ($wgPageTrailGlobalEnable && 24                                  $wgUser->getOption('page_trail') == 0); and 10       'tog-page_trail'                => 'Use Page Trail', in PageTrail.i18n.php to 10       'tog-page_trail'                => 'Omit Page Trail', I admit that double negations suck :-) Thoralf 13:51, 2 September 2008 (UTC)

position of PageTrail
In its current incarnation, the PageTrail-div is placed absolutely at the bottom of a page. Unfortunately, it partly overlaps content at this place - for instance the borders of Category: boxes. Is there any way to prevent this opverlapping? I fiddled around with the css in PageTrail.body.php, but couldn't find a reliable solution ... Thoralf 14:29, 2 September 2008 (UTC)
 * CSS is far from my forte... if anybody finds a good solution, I'll be more than happy to update the extension. Until then... Jean-Lou Dupont 14:33, 2 September 2008 (UTC)

CSS and Style Changes:
This is what I did to improve the rendering of Page Trail. Essentially, I moved the page trail to the top, removed the coloring, and remove the word 'Page Trail'. The div is not positioned absolutely so there are no issues with content being covered. This more closely mimics the conventional behavior of web site bread crumbs.

Patch for for version 1.0.5 of PageTrail.body.php follows. You might need to do something about those errant line endings. --- /tmp/old_pagetrail 2008-11-30 21:49:13.000000000 -0500 +++ /usr/share/php/MediaWiki/PageTrail/PageTrail.body.php  2008-11-30 21:49:48.000000000 -0500 @@ -52,11 +52,9 @@ '^M #PageTrail {^M font-size:0.8em;^M -   background-color: #FFFFCC;^M -   position:absolute;^M -   left: 2px;^M -   bottom:0;^M -   width:99%;^M +   margin-top:10px;^M +   margin-left:-10px;^M +   text-align:left;^M ';^M ^M $op->addScript( $style );^M @@ -95,7 +93,7 @@ ^M $m_skin =& $wgUser->getSkin;^M ^M -      $line = " Page Trail: ";^M +      $line = " ";^M ^M if ( !empty( $trail ))^M foreach( $trail as $index => &$e )^M