Editing the {{Tabs}} template. there appears to be an error in it

In the Dutch community there is some brainstorming going on to split the NL:Overzicht Nederlandse Verkeersborden article because of the too many expensive function calls error.

One of the options discussed is the use of the {{Tabs}} template. An experiment page has been setup. When using multiple {{Tabs}} templates on the same page they ended up nested.

As a hack (I experienced this behavior before) I added close table codes |} and this stopped the nesting.

Then I had a look at the template code and found this

|colspan="21" style="border:1px solid #AAA;border-top:none;{{#if:{{{no_bottom_border|}}}|border-bottom:none;|}} padding:2px .5em"|<noinclude>
Sample content
|}{{Documentation}}</noinclude>

The close table code is embedded in the <noinclude> section.

I propose the following change

|colspan="21" style="border:1px solid #AAA;border-top:none;{{#if:{{{no_bottom_border|}}}|border-bottom:none;|}} padding:2px .5em"|<noinclude>
Sample content</noinclude>
|}<noinclude>{{Documentation}}</noinclude>

effectively cutting the |} out of the <noinclude> section.

Does anybody sees any problems wit this?

1 Like

No.
The reason it is omitted is that the entire remaining page is part of this table, and at the end it is added automatically by the wiki software. This way you don’t need a second template at the end of the page which places it manually, which you could forget and then it’d work the same as it does now anyway.

I don’t know what the difference between Template:Tabs and Template:TabBar is, but at the end of it’s source it explains;

This table is deliberately left open so that the entire page gets a border. There is no closing tag; MediaWiki closes it automatically at the end of the page.

You can copy the Template:Tabs page to the sandbox in your user-namespace, and then render any page on the wiki with that instead by using the https://wiki.openstreetmap.org/wiki/Special:TemplateSandbox .

Oops, no that special page doesn’t exist in the osm wiki.
Well, you can still copy it to a user namespace page, and then create another page using that template to preview.
Canonically this can also be done by using the templates sandbox, as linked to at the bottom of the documentation of it. Then also create the testcases, and then you can use both the actual template and the sanbox version (with your changes) to compare the output.

Looking at how the english wiki uses this can be helpful for examples on how this works, but the osm wiki can differ in some points, so don’t just copy paste something expecting it to behave identically.

Incidentally, they use Template:Page tabs - Wikipedia which in turn uses a Module, not just templates.

Same purpose.

But after a quick look these are the differences I’ve noticed:

  • Tabs: completely self contained with a max of 9 [1] tabs.
  • TabBar: container template requires Template:Tab - OpenStreetMap Wiki for the individual tabs. In theory an unlimited number of tabs. Sidenote: the documentation for Tabbar also mentions a template Tab Small but that has been changed into a redirect in June 2016

That is a matter of age :slightly_smiling_face: The Module was implemented in December 2013. Before that it was a regular template with a max of 12 tabs

edit: typo


  1. Maybe 10 ↩︎

Looks like not closing the table is by design. So I will not implement the change.