Page MenuHomePhabricator

Hook at end of sidebar in Monobook
Closed, ResolvedPublic

Description

Author: lcarsdata

Description:
It would be nice to have a hook at the end of the sidebar so extensions can add
adverts for example. This would only be in Monobook as other skins use a
different layout, they can be added for other skins in a different bug report.


Version: unspecified
Severity: enhancement

Details

Reference
bz9230

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:41 PM
bzimport set Reference to bz9230.
bzimport added a subscriber: Unknown Object (MLST).

lcarsdata wrote:

Patch for this issue

attachment sidebar_hook.txt ignored as obsolete

lcarsdata wrote:

ok this should work, but it still doesn't load in to BugZilla how I want ;(

Attached:

robchur wrote:

Comment on attachment 3324
ok this should work, but it still doesn't load in to BugZilla how I want ;(

Documentation is incorrect.

lcarsdata wrote:

Comment on attachment 3324
ok this should work, but it still doesn't load in to BugZilla how I want ;(

Index: /docs/hooks.txt

  • /docs/hooks.txt (revision 20260)

+++ /docs/hooks.txt (working copy)
@@ -416,6 +416,9 @@
$mathRenderer: instance of MathRenderer
$errmsg: error message, in HTML (string). Nonempty indicates failure

of rendering the formula

+
+'MonobookSkinSidebarEnd': at end of sidebar in Monobook page
+$this is an instance of the monobook skin

'OutputPageBeforeHTML': a page has been processed by the parser and
the resulting HTML is about to be displayed.

/skins/MonoBook.php

  • /skins/MonoBook.php (revision 20260)

+++ /skins/MonoBook.php (working copy)
@@ -242,6 +242,7 @@

		</div>
	</div>

<?php } ?>
+ wfRunHooks( 'MonoBookSkinSidebarEnd', array( &$this ) );

		</div><!-- end of the left (by default at least) column -->
			<div class="visualClear"></div>
			<div id="footer">

lcarsdata wrote:

Comment on attachment 3324
ok this should work, but it still doesn't load in to BugZilla how I want ;(

Index: /docs/hooks.txt

  • /docs/hooks.txt (revision 20260)

+++ /docs/hooks.txt (working copy)
@@ -416,6 +416,9 @@
$mathRenderer: instance of MathRenderer
$errmsg: error message, in HTML (string). Nonempty indicates failure

of rendering the formula

+
+'MonobookSkinSidebarEnd': at end of sidebar in Monobook page
+$this: Code to be executed

'OutputPageBeforeHTML': a page has been processed by the parser and
the resulting HTML is about to be displayed.

Index: C:/Program Files/xampp/htdocs/mw/skins/MonoBook.php

  • /skins/MonoBook.php (revision 20260)

+++ /skins/MonoBook.php (working copy)
@@ -242,6 +242,7 @@

		</div>

</div>
<?php } ?>
+ wfRunHooks( 'MonoBookSkinSidebarEnd', array( &$this ) );

		</div><!-- end of the left (by default at least) column -->
			<div class="visualClear"></div>
			<div id="footer">

(In reply to comment #6)

Can the new SkinBuildSidebar hook
(http://www.mediawiki.org/wiki/Manual:Hooks/SkinBuildSidebar) be usefult for
this?

Yes. The hook allows you to add new items to the sidebar or inject arbitrary HTML. Marking this FIXED.