Extension talk:MenuTabs

Not working
Doesnt work for me. I have mediawiki 1.5.4 (dont worry not on the internet) and php 4.3.10. What I get get is a bullet list instead of menu tabs. I have inserted the css to main.css as well. --202.1.192.199 19:36, 26 January 2006 (UTC)

Which Browser
Can you provide more details so I can improve this? Which browser were you using? I have tested with IE6 and FireFox 1.5 only so far. I have made some changes to the CSS on the Content Page so try cutting and pasting again. I am runng MW 1.5.6 on PHP 4.4.1, here is screenshot using the (slightly modified) MonoBook skin: RobertCastley 23:22, 26 January 2006 (UTC)


 * I am using opera. With the modified version of CSS, now it works with opera too. Thanks --202.1.192.199 02:19, 27 January 2006 (UTC)


 * Excellent, thanks for the feedback.--81.144.178.66 08:30, 27 January 2006 (UTC)



When used as a template...
When MenuTab syntax used inside a template, and when the template is used in an article that contains  , the content inside   is replaced with something similar to   &larr; This is variable...

Probably a mediawiki bug? --Oblivious 07:59, 30 January 2006 (UTC)


 * Since developing this I have noticed this too. I haven't found a solution yet but there is a FAQ on extensions that seems to point to this fact, see http://meta.wikimedia.org/wiki/MediaWiki_extensions_FAQ#Templates_with_extension_tags --RobertCastley 23:40, 30 January 2006 (UTC)

Code fix for using Menutabs in Templates
The code on the main page has been updated to fix the problem with using the tabs in templates --RobertCastley 12:33, 7 February 2006 (UTC)
 * Thanks... was looking forward for this! --Oblivious 06:03, 12 February 2006 (UTC)

Wrapping Menu Tabs
I'm using MediaWiki 1.6.3 and your latest MenuTabs extension. I'm finding that the last tab is wrapping, as shown:



If I make the title of the last tab shorter (from "Electronic Design Automation" to just "EDA"), it does not wrap. Is there an implied length of the tabs before this occurs? Is there a way to change this?

Thanks. --Mgenovese 04:22, 13 April 2006 (UTC)

You can adjust the width in the CSS i.e. change 45em to 55em.

- Robert

Change the link?
This may be a very noob question but now the tabs link to the " edit" pages. What do you need to do make it link to the article ?

thx,

Answer: The page needs to exist first, if you are getting the edit function then I assume you are seeing an empty box which means no entry exists yet.

Follow Up: Problem Solved - In addition to the above Answer you should check your user preferences as I had the same problem which was resolved once I checked "Disable Page Caching" from the "Misc" tab on the "Preferences" page.

Using TinyMCE as wysiwyg editor causes the tab code to fail
I'm basically seeing the code in a CODE window. What can i do to get around this?

Thanks.

Thanks!
I wanted to thank you for creating MenuTabs! It works great and I've incorporated it into my wiki - see http://www.mathcasts.org -- Tim Fahlberg

RobertCastley Hehe! Cool, thanks for the feedback!

You're so welcome Robert! I just love MenuTabs and deeply appreciate your work on it! -- Tim Fahlberg

Question: Cool extension btw!. I was wondering how Tim can have the menu tab on each of his page with the correct tab highlighted? Do i have to include this in every page that i create or is there a template i can add it to ? Thanks. -- Jon

Very cool Robert
MenuTabs is great Robert, thanks for sharing. I have a suggestion: is it possible to make it so the main menu tab can stay highlighted when you go to a sub menu item, say, if, by having your main menu item addressed to "Office Manual" and the sub menu addressed to "Office Manual:example|example" ? i.e. by using the colon the main menu tab, "Office Manual," and the sub menu tab, "example," would both be highlighted. -Christiaan 12:30, 25 July 2006 (UTC)


When i use Menutabs I get a text  extra for each menu/submenu item on te screen. I work with version 1.7.1 at my webserver. On my local PC I got 1.6.7 and it works great. Who can help? BB70 12:09, 28 July 2006 (UTC)


 * Remove the occurances of "  " from lines 69, 71, 92. Tested so far with Firefox 1.0.4, IE 7, and Mozilla 1.7.7. --68.121.254.86 22:06, 2 August 2006 (UTC)

RobertCastley Since the 1.7.x release came out with no real warning of PHP5 only support I am not able to test/fix MenuTabs. So like a lot of MediaWiki users out there I am unable to upgrade to the 1.7.x release as it will probably break other extensions I have installed and running. In my production Wiki I have GeshiHightlight, inputbox, wikicalendar, RSS and Freemind extensions and as they all use something similiar to MenuTabs I can only guess they will be broken too!

This seems like a great idea but as far as I can tell, the subtab always seems to be the same. It seems to me that there needs to be a way to have different sets of subtabs depending on which main tab has been selected. DavidJameson 13:48, 10 August 2006 (UTC)

Subtabs?
Shouldn't the submenu change based on the main tab position? What is the reason for a submenu if it is not dynamically changing based on the main tab click?

&lt;/li&gt; fix
MediaWiki Version 1.7.1

PHP Version 5.1.4

We ran into the same &lt;/li&gt; problem as one of the previous posters. The fix was to change the location of the parsing inside the loop so that the url itself was parsed, but, the actual remaining html was not 'entified'.

Original code: foreach ($fields as $field) { if ($title == $field) { $item .= " $field \n"; } else { $item .= "$field\n"; }       }        $output = & $parser->parse($item, $wgTitle, $parserOptions); $linkoutput = $output->getText; return $prepend. $linkoutput;

Modified version: foreach ($fields as $field) { $url = & $parser->parse($field, $wgTitle, $parserOptions); $parsed_url = $url->getText; if ($title == $field) { $linkoutput .= " $parsed_url \n"; } else { $linkoutput .= "$parsed_url\n"; }       }        return $prepend. $linkoutput;

Also note that the subtab code had the same problem and is corrected in the complete new extension as displayed below.

Good for Mediawiki 1.10.1
The code below here, not written by me, is good for Mediawiki 1.10.1. I'v tested it --Roc michael 15:57, 14 September 2007 (UTC)

 'MenuTabs', 'author' => 'Robert Castley', 'description' => 'allows for the creation of a menu navigation bar on each page if desired ');

function menuTabsCSS { global $wgOut; $css = << width: auto; display: block; float: left; padding: 4px 0px; padding-left: 4px; padding-right: 4px; margin-top: 1px; margin-right: 2px; text-align: center; font-family: Arial; font-size: 85%; text-decoration: none; color: #333; } border: 1px solid #666; border-bottom: none; background: #e6f0ff; padding-bottom: 6px; padding-left: 4px; padding-right: 4px; margin-top: 0; } width: auto; display: block; float: left; padding: 0 5px; margin: 0; text-align: center; border: none; border-left: 1px dotted #AAA; background: none; } border-left: 1px dotted #AAA; } eof; $wgOut->addHTML($css); }
 * 1) main { border-top: 1px solid #666; clear: both; width: 100%; }
 * 2) contents { background: #9aa4b3; border-top: 2em solid #e6f0ff; }
 * 3) header { position: relative; width: 100%; height: 2em; width: 45em; }
 * 4) header ul#primary { margin: 0; padding: 0; position: absolute; bottom: -1px; left: 20px; width: 45em; }
 * 5) header ul#primary li { display: inline; list-style: none; }
 * 6) header ul#primary a,#header ul#primary span,#header ul#primary a.current, #header ul#primary strong {
 * 1) header ul#primary span,#header ul#primary a.current,#header ul#primary a.current:hover, #header ul#primary strong {
 * 1) header ul#primary a { background: #bbc8da; border: 1px solid #AAA; border-bottom: none; }
 * 2) header ul#primary a:hover { margin-top: 0; border-color: #666; background: #FFF7CD; padding-bottom: 5px; }
 * 3) header ul#secondary { position: absolute; margin: 0; padding: 0; bottom: -1.4em; left: 1px; width: 50em; }
 * 4) header ul#secondary li a,#header ul#secondary li span ,#header ul#secondary li strong {
 * 1) header ul#secondary li a { color: #06C; text-decoration: underline; }
 * 2) header ul#secondary li a:hover { color: #333; background: transparent; padding: 0 5px; border: none;
 * 1) header ul#secondary li a:active { color: #333; font-weight: normal; background: transparent; }
 * 2) header ul#secondary li:first-child a, #header ul#secondary li:first-child span { border: none; }

function wfMenuTabs { global $wgParser; menuTabsCSS; $wgParser->setHook( "maintab", "renderMainTab" ); $wgParser->setHook( "subtab", "renderSubTab" ); }

function renderMainTab( $input ) { global $wgOut; global $wgTitle; global $wgRequest; global $wgUser; global $wgParser; $parserOptions = ParserOptions::newFromUser( $wgUser ); $parser = & new Parser; $item = ''; $title = $wgRequest->getVal( 'title' ); $title = preg_replace("/_/", " ", $title); $fields = explode("||",$input); $prepend = "\n"; $prepend .= "\n"; foreach ($fields as $field) { $url = & $parser->parse($field, $wgTitle, $parserOptions); $parsed_url = $url->getText; if ($title == $field) { $linkoutput .= " $parsed_url </li>\n"; } else { $linkoutput .= "$parsed_url</li>\n"; }       }        return $prepend. $linkoutput; }

function renderSubTab( $input ) { global $wgOut; global $wgTitle; global $wgRequest; global $wgUser; global $wgParser; $parserOptions = ParserOptions::newFromUser( $wgUser ); $parser = & new Parser; $item2 = ''; $fields2 = explode("||", $input); $prepend = "<ul id=\"secondary\">\n"; foreach ($fields2 as $field2) { $url = & $parser->parse($field2, $wgTitle, $parserOptions); $parsed_url = $url->getText; if ($field2 != '') { $linkoutput .= "$parsed_url</li>\n"; }       }        $append = "</ul>\n"; $append .= "</ul>\n"; $append .= " \n"; $append .= "<div id=\"main\">\n"; $append .= "<div id=\"contents\"> \n"; $append .= " \n"; return $prepend. $linkoutput. $append; } ?>
 * This worked for me. - 129.94.6.30 07:33, 13 September 2006 (UTC)
 * Worked for me too on 1.8.2. After waiting about 20 min for the session to time about so it could re-cache. Rune.
 * Also worked on MW 1.11.0--Roc michael 22:55, 8 November 2007 (UTC)

Dynamic MenuTabs using DPL2?
I think this is a really good extension, however there is one bit of extra funtionallity that would make it for me a great extension. Currently the tabs have to be statically defined either within the article, or in a template. If it could somehow be made to wok with the DynamicPageList2 extension, then we could do really cool stuff like:

Template:CategoryMenu Category:||<DPL>category= mode=inline inlinetext=|| count=10 titlemaxlength=15</DPL>

Thus allowing a set of dynamic tabs that will allow quick navigation between the pages of a given category. This would be extremely useful for categories with a relatively small number of members.

Currently when I try to implement the above code on my own wiki (MW 1.6.8), the <DPL>... </DPL> is taken literally, not evaluated. I've tried hacking the extensions together myself - adding a new 'mode' to DPL called menutabs which calls the renderMainTab function from MenuTabs.php, but my PHP knowledge is rather limited and I've yet to get this working properly. I'll keep trying for now, and will probably end up eventually with something that works, but is rather ugly. If anyone has any good ideas for how to better integrate these two extensions, please post here. --OneSeven 02:09, 4 October 2006 (UTC)

BAD RENDERED WITH CAVENDISH SKIN
I am running MediaWiki 1.9.2 with PHP 5.2 and MenuTabs works fine on Monobook but does not work right with Cavendish skin. First of all, after i added the include line to LocalSettings.php, the top bar of the cavendish skin gets squeezed. Besides, the MenuTabs themselves render very bad. Any solution?? --201.235.235.49 23:42, 4 March 2007 (UTC)

usage with Mediawiki:Sitenotice
Hi,

I've a problem. I tried to add MenuBar on each Mediawiki page. I've created a template - Template:TopMenu, then I have added it to Mediawiki:Sitenotice. Text put on this page is rendered on each MW page.

However there is a problem with the display of the elements that were chosen. Sometimes they're flat - i.e. it's not possible to click them even if I'm on the other page of the menu or even mediawiki. I'd be v.grateful for any help.

Regards, Aretai 10:48, 23 March 2007 (UTC)

li problem in MW 1.10.1
I have MW 1.10.1 and I get /li after every tab, Any suggestions, for change ?

=> try this.
 * Didn't work for me. I got the following error:
 * Notice: Undefined variable: linkoutput in /home/fandomin/public_html/extensions/MenuTabs.php on line 73


 * Notice: Undefined variable: linkoutput in /home/fandomin/public_html/extensions/MenuTabs.php on line 103

--User:Purplepopple,

How do I use the code from inside monobook.php template?
I am new to Mediawiki (version 1.5.8 - inside Joomla as a Component = Mambowiki). I found your excellent template while trying to create a user navigation system - it's great, and just what everyday surfers need. What I want to do is put it into the Template above the page title but I can't find information on how to include the template call into the template itself. The MenuTabs template call works great inside each article but it does not look quite right. Can I call a MediaWiki "template" inside of monobook.php for example or is it not allowed? Also, how do I get a tab to show a category - if I put the tab is not shown. Only document links seem to be shown? 79.66.177.10 14:52, 17 September 2007 (UTC)