Extension talk:BackwardNavigation

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] Fix for 1.11.0 +

Every function must return something so just add TRUE to any Return ; as so in BackwardNavigation_body.php :

        if (!is_object($wgMessageCache)) return true;
        if ( $messagesLoaded ) return true;

[edit] Customizing your skins

To get this work, you must have your own template file into the skins/ directory.

[edit] Quick-creation of a new template

  • Copy-paste MonoBook.php into Foo.php
  • Copy-paste monobook/ sub-directory into foo/
  • Into MonoBook.php, replace all MonoBook occurences with Foo
  • In your LocalSettings.php configuration file, you can change $wgDefaultSkin from 'monobook' to 'foo' to get this by default

Then you can customize your skin to make this extension work :

  • Replace something looking like this :
    <li id="t-whatlinkshere"><a href="<?php
    echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
    ?>"<?php echo $skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
    

    with this :

    <li id="t-whatlinkshere"><?php
    global $wgTitle;
    $backNav_controller=new BackwardNavigation();
    echo $backNav_controller->executeBackwardNavigation($wgTitle->getArticleID())
    ?></li>
    
  • And thats it

[edit] Customizing the css

Add the customization lines at the end of skins/foo/main.css :

.popup{
        text-decoration: underline;
        position: relative;
}
 
.popup:hover{
        background-color: transparent;
        text-decoration: none;
}
 
div.cadre_popup{
        visibility: hidden;
        position: absolute;
        z-index: 10;
        text-decoration: none;
        top: 0px;
        left: 0px;
        background-color: white;
        color: black;
        border-collapse: collapse;
        border: 1px solid #aaa;
        padding: 0 .8em .3em .5em;
}
 
#referer_popup {
        //top: #popupanchor.top;
        z-index: 100;
}
 
span:hover.popup div.cadre_popup{
        top: 0px;
        left: 0px;
        visibility: visible;
}
 
span .popup div:hover.cadre_popup{
        visibility: visible;
}
 
a.popup {
        text-decoration: none;
}
span.popup {
        text-decoration: none;
}

Here we are ;-).

[edit] Multi-namespaces use

If you've got problems using BackwardNavigation with multiple-namespaces, simply change this line in BackwardNavigation_body.php :

change this :

$SQL="SELECT pc.page_id referer FROM ! p INNER JOIN ! pl ON (p.page_title=pl.pl_title) INNER JOIN ! pc ON (pl.pl_from=pc.page_id) WHERE p.page_id=? and pc.page_namespace=0 order by referer";

with this :

$SQL="SELECT pc.page_id referer FROM ! p INNER JOIN ! pl ON (p.page_title=pl.pl_title) INNER JOIN ! pc ON (pl.pl_from=pc.page_id) WHERE p.page_id=? order by referer";

(look : I've just removed "and pc.page_namespace=0")

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox