Editing MediaWiki:Sidebar

Use this forum to ask questions about how to do things in GuMax skin.
Post Reply
User avatar
TheMilkman
Rank 0
Rank 0
Posts: 3
Joined: July 28th, 2009, 3:49 pm

Editing MediaWiki:Sidebar

Post by TheMilkman »

I like the skin you have created, but I had a couple of questions.

The Pull down menu in GuMaxDD does not appear to be dynamic, or I'm missing something. The pulldown menus are just a replica of the text in MediaWiki:Sidebar and not dynamically generated like before, ie the ToolBox in monobook.
If there is a way to make the pull-downs dynamic it would be nice to know. I have a piece of code I wrote for monobook that lists your Watchlist as a Favorites link and it would be cool to be able to do the same with the drop-down menus.

An example of a favorites box and the code used can be seen at http://www.losbyers.com/mediawiki/index.php/Wiki_notes. Although, unless you login and add some links to your Watchlist the Favorite box will be empty. It has been very handy to be able to add and remove pages from the favorites as needed, ie you are working on a document it's "bookmarked", but when you are done you can remove it.

Thanks
TMM
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Editing MediaWiki:Sidebar

Post by Paul »

I'm not sure what your "dynamic" means, I'm pretty sure you miss something or misunderstand something. My suggestion is to read the skin page and sample carefully at http://paulgu.com/wiki/Drop_Down_Menu_Series.
User avatar
TheMilkman
Rank 0
Rank 0
Posts: 3
Joined: July 28th, 2009, 3:49 pm

Re: Editing MediaWiki:Sidebar

Post by TheMilkman »

From the page you link it looks like to build the pull-down menus you have to have static links in the MediaWiki:Sidebar page. The admin places the links there and they are the same for every user.

If I wanted the users to be able to have their own "Favorites" pull-down menu the data for the menu would need to be different for each user, thus it would need to be dynamically built, not static.

Sort of like the function you have "function wikiSpecialToolBox()" which dynamically builds the toolbox items in the page footer. I would want a function that builds a pull-down menu.
User avatar
TheMilkman
Rank 0
Rank 0
Posts: 3
Joined: July 28th, 2009, 3:49 pm

Re: Editing MediaWiki:Sidebar

Post by TheMilkman »

Well I got it figured out.

If you want dynamic pull-down menus that are generated from PHP code and not statically set from the MediaWiki:Sidebar then you need to add your own menu items to the gumaxdd.php script. The pull-downs will be after anything listed in the MediaWiki:Sidebar.

Example:
Right after the code in the mainNavigationBox() function.
FIND

Code: Select all

} else {
			# allow raw HTML block to be defined by extensions
			//print $cont;
		}
?>
		</li>
<?php	} ?>
ADD after

Code: Select all

<li> <a href="<?php $this->text('scriptpath') ?>/index.php?title=Favorites">Favorites </a>
		<ul>
		
<?php 
** The PHP code to build a list of <li> stuff </li> **
?>
		</ul>
		</li>
I was able to build a pull-down with a Title of "Favorites" and the items listed were those on each persons Watch List
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: Editing MediaWiki:Sidebar

Post by Paul »

This is great, however it's not part of skin... more like enhancement or customization... The skin has to be general.
Post Reply