Extension talk:Tabs

Jump to navigation Jump to search

About this board

LarryAlgo (talkcontribs)
diff --git a/Tabs.body.php b/Tabs.body.php
index 16d12b4..1c30aa9 100644
--- a/Tabs.body.php
+++ b/Tabs.body.php
@@ -398,7 +398,7 @@ class Tabs {
                                '.tabs-dropdown li,'.
                                '.tabs-dropdown ul,'.
                                '.tabs-dropdown ol {'.
-                                       'background-color: '.wfMessage('tabs-dropdown-bgcolor').
+                                       'background-color: '.wfMessage('tabs-dropdown-bgcolor')->text().
                return "<style type=\"text/css\" id=\"tabs-dynamic-styles\">/*<![CDATA[*/\n/* Dynamically generated tabs styles */\n$css\n/*]]>*/</style>";

Found this was interfering with math tags on my page, and dug it down to this. I am not familiar with innards, but this fixed it for me.


LarryAlgo (talkcontribs)

Also just to add that I ran into this again, this time with bisecting it to this change:

--- a/Tabs.body.php
+++ b/Tabs.body.php
@@ -92,7 +92,7 @@ class Tabs {
                        if (isset($names[$index-1])) { // if array $names already has a name defined at position $index, use that.
                                $name = $names[$index-1]; // minus 1 because tabs are 1-based, arrays 0-based.
                        } else { // otherwise, use the entered name, or the $index with a "Tab " prefix if it is not defined or empty.
-                               $name = trim(isset($attr['name']) && $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index));
+                               $name = trim(isset($attr['name']) && $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index)->text());
                if (!$nested && !$nestAttr) { // This runs when the tab is not nested inside a <tabs> tag.

I also noticed the pattern and went ahead and changed found all my "wfMessage" and added ->text(). I'm still an amateur to mediawiki.. I can sent a patch when I'm in an easier place to do so.

Reply to "Minor bug?"
Knetschkäfer (talkcontribs)

I tried everything but the tabs do not work. I write:





but it does not work. The tabbers are shown but they don't work.

Please can someone help me? The tabs are very important to our wiki.

Thank you!

Knetschkäfer (talkcontribs)

Here is a test page from my wiki: wiki.silverfang.net/Tabber_Test_Page

Joeytje50 (talkcontribs)

Apologies for the late reply. As it seems, on that linked page, the tabs extension to which you are commenting here, does seem to work fine. This extension does not include the Tabber extension, which is its own extension. If you want to use that, you can install it separately, but the tabs do function just fine the way you show on that linked page.

Reply to "Tabs do not work"
Legaulph (talkcontribs)
MediaWiki	1.30.0
PHP	7.1.8 (apache2handler)
Semantic MediaWiki	2.5.5
Tabs 1.3.2
Tabs no longer working at all
CyberBotX (talkcontribs)

I am getting the same issue, with MediaWiki 1.30.0 and PHP 7.0.27, with the same version of Tabs (but from the master branch). From what I can see, the error is due to the styles not being applied and it appears to be a problem with the extension, as I get in the Debug Log when I turn on the Debug Toolbar of MediaWiki:

[resourceloader] Unexpected general module "ext.tabs" in styles queue.

I've been looking to see how this can be fixed, but cannot find a fix for it. Things I tried:

  • Commenting out usages of addModuleStyles() and addModuleScripts() in Tabs.body.php
  • Changing extension.json (but this problem was occurring even with the version of Tabs from the REL1_30 branch and editing Tabs.php instead) to have the styles and scripts separate, which removes the error but doesn't load the styles
  • Changing the uses of addModuleStyles() and addModuleScripts() to just addModules()

None of these have worked, though.

Legaulph (talkcontribs)


I was able to get rid of the message [resourceloader] Unexpected general module "ext.tabs" in styles queue
Tabs.body.php change
This message is also showing
  • [GlobalTitleFail] MessageCache::parse called by Tabs->renderTab/trim/Message->__toString/Message->toString/Message->parseText/MessageCache->parse with no title set.
--Legaulph (talk) 12:48, 2 March 2018 (UTC)
Legaulph (talkcontribs)
Josh Simon (talkcontribs)

I'm curious: What was your "No longer working" failure mode?

I installed a fresh MW 1.31 instance (PHP 7.2.7) and now with the same tab-generating wikitext and version of Tabs (1.3.2) that works in my old MW 1.30 instance (PHP 5.5.38) instead of tabs I get radio buttons for each tab title and all the text from all the tabs below them. Commenting out the $parserOut->addModuleScripts('ext.tabs'); line and loading the AddMessages extension suppresses the MW debug log messages (as you note above), but still doesn't display the tabs.


Legaulph (talkcontribs)

Sorry for the late reply. I'm not sure what you mean by failure mode. The tabs would not work, MediaWiki was working fine just could not get tabs working. I'm recently testing on MediaWiki 1.31

MediaWiki	1.31.0
PHP	7.1.8 (apache2handler)
MySQL	5.6.34-log
Tabs	1.3.2

everything is still working with the configuration above. It may have to do with PHP 7.2.7 or did you change the line above $parserOut->addModuleStyles('ext.tabs'); to $parserOut->addModules('ext.tabs');?

Josh Simon (talkcontribs)

Aha! I missed the "replace with..." piece. If I change ...->addModuleScripts... to ...->addModules... on line 378 of Tabs.body.php then the tabs do work as expected again (MW 1.31, PHP 7.2.8, Tabs 1.3.2). Thanks!!

Unnamed mercenary (talkcontribs)

Currently using MW 1.31.1, PHP 7.2.15, and Tabs 1.3.2 and I've applied the changes noted above.


I've also added the AddMessages plugin as advised, which did fix the tab buttons themselves. However, I'm encountering a bug where most of the tab content won't be displayed. It'll make it to a 3rd tab, and then stop displaying any afterwards.






Paladox (talkcontribs)
Jamal22066 (talkcontribs)

When attempting to render a PDF using mwlib rendering server, the rendered PDF shows the source code instead of the published page. This is likely a mwlib problem but was wondering if anyone has a fix/workaround.

Joeytje50 (talkcontribs)

I'm sorry but I don't really understand what the problem is. Which extension or script is not working?

Jamal22066 (talkcontribs)

The issue was that mwlib can only convert the Wiki markdown language. I was using the 'tabber' extension which is used to create tabs on a page. mwlib can not render a page properly that is using this extension because it is not wiki markdown language.

Reply to "PDF rendering problem" (talkcontribs)

Hello I installed the tabs extension last night and I've realized that the following contents are not working properly for some reason. I've tried all of the methods below and they don't seem to resolve what I am looking for. Here are the examples:


This image above shows the proper one in another site, and tabs above work and adjust the page as I click different tabs. This is how it is supposed to work.


This is mine. I tried to make it work like the first link, but it doesn't work like as I wanted it to be. pages don't adjust either. the codes are same too.

Is there something I am doing wrong in this situation? Please help. (talkcontribs)

What versions are you running mediawiki, PHP, (talkcontribs)

I am currently using latest mediawiki that's released. as for PHP, 5.5.51-38.2 - Percona Server (GPL), Release 38.2, Revision 727

Reply to "Boxes don't work properly"
Betmidrash (talkcontribs)

A new tab

Hello, can I add a new namespace to the pages, like talk namespace, and to call it 'draft'. But I want it to be in a new tab like the tab 'discussion', near the page. Actually, maybe I don't need a new namespace, just a new tab, but not like here or here, because it made the tab inside the page, I want it in the head of the page, near the discussion tab. someone?


Joeytje50 (talkcontribs)

I'm sorry but that is not possible with my extension either. Those tabs are generated automatically by the page, so they are not part of the content. While it may be technically possible to make an extension that would do this, I think this is too specific to add to any existing extension. I think the best extension for you (if you want the whole page to be a tabbed interface) would still be Header Tabs.

Alternatively you could use javascript to make your own extra 'tab' at the top of the page, but I think that is unnecessary extra work if HeaderTabs basically does what you want to do.

Betmidrash (talkcontribs)

O.k. Thank you very much.

Reply to "A new tab"

#Tag:Tab and #Tab seems to be broken when inside #Tag:Tabs

3 (talkcontribs)
Imamadmad (talkcontribs)

I can confirm that I'm seeing the same problems (talkcontribs)

It's a mighty shame, otherwise this would've been the perfect tab extension, and I would have no more use for tabber. Now I have to use both and sometimes even both won't do.

Reply to "#Tag:Tab and #Tab seems to be broken when inside #Tag:Tabs"
Imamadmad (talkcontribs)

Hi there. I tried to generate a set of tabs using a Lua module but it seems the tags are parsed before the module as they were left as plain text. Any suggestion as to what format should be output by the Lua module for this to work properly?

Reply to "Generating tabs with Lua Module"
2605:E000:858B:F900:18A2:6FDA:1C30:8E5C (talkcontribs)

Hi, is it possible to use images inside the tabs? So far I can only get text to work.

Reply to "Adding images"

collapsed attribute in template can't work

1 (talkcontribs)


I create the mediawiki template "novel" as below:

{{#tag:tab |{{{content|{{{1|'''Warning! there is no content.'''}}}}}} |{{#if:{{{collapsed|}}}|{{{collapsed}}}}} |class=novel |openname="{{#if:{{{openname|}}}|{{{openname}}}}}(Click to show)" |closename="{{#if:{{{closename|}}}|{{{closename}}}}}(Click to hide)" |style="background:white; width:100%" }} 

But when I use the template:

{{template:novel |content=This is a test ! |collapsed=collapsed }} 

the toggle box can't appear collapsed ! Do you know why? I am looking forward to your repaly!

Reply to "collapsed attribute in template can't work"