Jump to content

Template talk:Page tabs

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Page tabs/doc)

Background color

[edit]

{{editrequest}} Is there any way to force the background color? I would like to make it transparent so if there is a background color on the page of the project, there isn't this big, white-blue line across the page.

I believe that changing this line:

  • {{PageTabsTop|NOTOC={{{NOTOC|false}}}}}

to this:

  • {{PageTabsTop|NOTOC={{{NOTOC|false}}}|Background={{{Background|#F8FCFF}}} }}

May do this. --Jeremy (blah blahI did it!) 07:56, 11 February 2011 (UTC)[reply]

I've reduced the protection, so feel free to make the change yourself. If you need help, let me know. — Martin (MSGJ · talk) 16:11, 11 February 2011 (UTC)[reply]
Thank you again for your help! the change appears to have worked. --Jeremy (blah blahI did it!) 18:33, 11 February 2011 (UTC)[reply]

Tenth tab

[edit]

Would it be possible to add a tenth tab? Rcsprinter (talk) 15:00, 22 June 2011 (UTC)[reply]

20 tabs

[edit]

I've reprogrammed the template to support up to 20 tabs. Yee-haw!!! Please replace the current template with this: User:Lionelt/test. Thanks– Lionel (talk) 07:38, 28 October 2011 (UTC)[reply]

I agree with the changes, but will it fit on a page? --Jeremy (blah blahI did it!) 07:43, 28 October 2011 (UTC)[reply]
Well, it doesn't wrap. Thus you may never use 20--unless the tab names are very small. Note that you don't have to use 20--only use as many as will fit on the page.– Lionel (talk) 07:49, 28 October 2011 (UTC)[reply]
Tested here WP:WikiProject Conservatism, WP:WikiProject Conservatism/tabs. – Lionel (talk) 08:09, 28 October 2011 (UTC)[reply]
I've copied your test page to Template:Page tabs/sandbox, mainly for ease of diffs. Why do you add "|*" to all the conditions? Tidy abuse? If you're trying to prevent extraneous newlines in the output, the usual thing to do is to comment them out:
{{foo|{{{1}}}}}<!--
-->{{#if:{{{2|}}}|{{foo|{{{2}}}}}}}<!--
-->{{#if:{{{3|}}}|{{foo|{{{3}}}}}}}<!--
-->{{#if:{{{4|}}}|{{foo|{{{4}}}}}}}<!--
-->and so on
Anomie 11:10, 28 October 2011 (UTC)[reply]
Request disabled due to lack of response. — Martin (MSGJ · talk) 11:26, 2 November 2011 (UTC)[reply]

Tab color parameters

[edit]

tab1-bg, tab2-bg and tab-border don't work. I suspect it is because they have to be passed to {{PageTab}} when it is called. I.e. on all 10 lines, or in the pending new version, all 20 lines.– Lionel (talk) 07:58, 28 October 2011 (UTC)[reply]

Out of interest, does {{start tab}} work for you? I've swapped the Conservatism project over to use it for the moment as I think it's a technically better solution than {{page tabs}}. Chris Cunningham (user:thumperward) - talk 12:25, 28 October 2011 (UTC)[reply]

Blue tab dissapears

[edit]

Hi

It may be that I just haven't noticed, but it seems that there has been a change in the tabs I use causing a small problem for me. I used the tabheader set for the top tabs (User:Chaosdruid/tabheader), each top-row page and sub-page having {{User:Chaosdruid/tabheader}} to place the top row of tabs in them.

  1. User:Chaosdruid - Here the top line first tab (User page) is dark-blue and the second-line first tab (Fav. Music) is white.
  2. When I click the Fav. music tab the page changes, the tab stays white, but the top-row tab goes to the light-blue colour.
  3. If I click on the third top-row tab (Articles Projects Cats), it changes to dark blue and the first second-row tab is white (Wiki).
  4. If I click the second-row second tab (Robotics) the top-row tab goes back to light-blue.

I thought (as I cannot be sure it did this) that when I originally created the tabs, no matter which tab on the second line I chose, the original top tab stayed dark blue.

It is only a small issue, but I cannot keep track of which top-row tab the page I am on is a subset of. Did something change to cause this, and is it easily fixable? I did initially think it was due to the rename of the PageTabs -> Page tabs, but that seems to be incorrect.

Can I use a nested or repeated "Page tabs" to give me the same result? Chaosdruid (talk) 18:47, 20 March 2012 (UTC)[reply]

Not sure if it's any help, but I've got 2 levels of tabs at User:Boing! said Zebedee/Media, which seem to work fine. -- Boing! said Zebedee (talk) 18:56, 20 March 2012 (UTC)[reply]
That is a great help :¬) It will at least give me an alternative for now if I cannot fix it. The only issue might be the small tab sizes, but I will play around with it later.
I will try and recreate it using the same one page for the first line, it might be a bit cumbersome for me having to duplicate the whole first set on every page as I have quite a lot of them, but I will try it and report back.
Once again many thanks Chaosdruid (talk) 19:07, 20 March 2012 (UTC)[reply]
Cool - I'll be interested to hear how it goes. -- Boing! said Zebedee (talk) 19:21, 20 March 2012 (UTC)[reply]
Its fine :¬)
I had to create a new page for each of the top-row tabs, and change the page from "tabheeader" to "toptabsX" on the pages, but it was quick and surprisingly easy to do!
I have done the first three top-tabs from my User page if you want to look at them. The top-tab pages are User:Chaosdruid/toptabs, User:Chaosdruid/toptabs2 etc. Chaosdruid (talk) 19:49, 20 March 2012 (UTC)[reply]
They're looking good :-) -- Boing! said Zebedee (talk) 19:58, 20 March 2012 (UTC)[reply]

Reinstating the 20 tab from above - though with 12

[edit]

Any chance we can get a good code agreed for expanding the tabs to at least 12?

I have had many instances where I could have done with 10 or 11, and as 20 seems a little unrealistic, we could just go to 12 - which could be easily achieved by using the code from the sandbox. (as per the above discussion) Chaosdruid (talk) 19:18, 20 March 2012 (UTC)[reply]

Done Anomie 22:54, 20 March 2012 (UTC)[reply]

The template documentation page still says that the maximum is up to 9 pages. I didn't change it because I'm not sure why the documentation says that the "This=" parameter can be from 1 to 19. Is it wrong? Squc (talk) 13:58, 4 April 2012 (UTC)[reply]

merging to {{start tab}}

[edit]

Hi folks,

Over the last while I've worked on migrating pages which used per-page implementations of {{page tabs}} to use a tab strip sub-page with the more flexible {{start tab}} (which has more features, doesn't need sub-pages except {{tab}} and doesn't require a This= declaration). I've now converted the sandbox here to call {{start tab}} directly: this will enable all existing uses to be translated across to the new code and leave us with a single code base. Please kick the tyres and check it works for you. Chris Cunningham (user:thumperward) (talk) 13:03, 19 April 2012 (UTC)[reply]

YES. Brilliant. That is so much better. This= was a major faff; your replacement is how I expected it to work. Thank you! Would you consider adding this prominently to the docs for this template to let people know a more modern alternative exists? — Hex (❝?!❞) 13:34, 4 October 2012 (UTC)[reply]

Hi there. When I originally created page tabs, I wanted a way to move my user pages (and possibly some others) to a space-saving way to make them still accessible. If you looked at the history, you'll see I first created them more than five years ago! I didn't know as much about the Wikimedia software as I do now, and it's entirely possible template functions were not as powerful then as they were now. Or, another way to put it is I never thought about it. The use of This= was a way to select the desired page and it worked, and, frankly, I never thought to go back and add new features. I suppose now it's a kluge, but at the time, I did not then know how to automatically select the current page. Plus, using This= allows someone to have multiple tab sets where none of the items are highlighted (I've gotten to that point for the comments to my user page):

, so I'll challenge you, can you make it so that I can choose to break the tab block into multiple lines and thus I could put my older pages (2003 through 2009) as the rear line? Then I'd definitely want to switch to the new method. Or, can you figure a way to test to see if This= is on a page and just support it, but if it isn't do the new auto choose. Then, those who didn't change and those who want autoselect would both be handled, and you'd get the best of both worlds, old code would work unchanged and new pages would work without having to use This= anymore. ("I'm as new as hell, and I'm not going to take use this anymore!" - Misquoted from Network)

Paul Robinson (Rfc1394) (talk) 04:44, 25 May 2013 (UTC)[reply]

suggestion javascript

[edit]

create a javascript tab that does not refresh the browser and quickly goes on to the page by click just tab. 94.7.128.200 (talk) 16:56, 9 May 2014 (UTC)[reply]

Tweak styling of tabs

[edit]

Should we tweak the styling of the tabs?

I have 2 options:

Option A

These lines at Template:Page tabs/styles.css

    display: flex;
    flex-wrap: wrap;

and

.template-page-tabs > span.spacer {
	display: flex; /* hides any whitespace we put inside */
	padding: 0;
	flex: 9px;
	border-width: 0 0 2px 0;
}

Change flex-wrap: wrap; to overflow: scroll; for a better mobile experience (the tabs dont wrap).

Change padding: 0; to padding: 3px; for a clear seperator of the tab (the border looks weird when combined with the above).

Option B

Add this to the end of the styles page:

@media screen and (max-width: 500px) {
    .template-page-tabs {
        flex-direction: column;
    }
    .template-page-tabs > span.spacer {
        display: none;
    }
    .template-page-tabs > span::first-child {
        border-bottom: #a3b1bf;
    }
}

So that the tabs will be converted to a vertical navigation list.

What do you think? SuperDragonXD (talk) 03:35, 3 March 2022 (UTC)[reply]

Tab background color

[edit]

For accessibility reasons, I'd like to suggest changing the background color of the tabs from #cee0f2 to #e0edf6. The standard link color (#3366cc) against the current shade of blue can be hard to read, and it falls short of the WCAG standards recommended by MOS:CONTRAST. hinnk (talk) 13:54, 16 April 2024 (UTC)[reply]

Ampersands don't work

[edit]

@GKFX, Deacon Vorbis, and Moxy: This template was intended for Wikilinks, but it also accepts unlinked text and external links. However, if a parameter includes an ampersand, the parameter is ignored.

This comes up because User:JeyReydar97 uses this template with parameter {{User:PC-XT/KIS/editcount|JeyReydar97|label=edit count|tool=pcount}}, which emits block-level markup (<div>...</div>), which causes a div-span-flip lint error, and in an effort to fix the div-span-flip lint error, I tried to substitute [https://tools.wmflabs.org/xtools/pcount/?user=JeyReydar97&project=en.wikipedia.org edit count], and it wouldn't display, and I determined that the ampersand was the culprit. —Anomalocaris (talk) 05:55, 4 July 2024 (UTC)``[reply]

Anomalocaris, the problem is the equals signs. Instead of
 | [https://tools.wmflabs.org/xtools/pcount/?user=JeyReydar97&project=en.wikipedia.org edit count]
try:
 | 5=[https://tools.wmflabs.org/xtools/pcount/?user=JeyReydar97&project=en.wikipedia.org edit count]
|5=, since the edit count KIS box is the fifth tab. This issue and how to deal with it is described at Help:Template#Hints and workarounds. Instead of a fifth parameter with a "edit count" link, the first option creates a parameter named [https://tools.wmflabs.org/xtools/pcount/?user with a given value JeyReydar97&project=en.wikipedia.org edit count]. —⁠andrybak (talk) 19:09, 7 July 2024 (UTC)[reply]
andrybak: That worked, thanks! —Anomalocaris (talk) 06:50, 8 July 2024 (UTC)[reply]

On commons?

[edit]

I’m trying to get this page on the wikimedia commons. But I can’t edit it so I can’t put it on the commons. Atlas Þə Biologist (talk) 00:48, 7 October 2024 (UTC)[reply]

I'm not sure I understand why being able to edit the page is required in order to copy it to Commons — you can still view the page source even if you don't have edit access, right?
Regardless, you can't copy Template:Page tabs to commons for the simple reason that it's already there. FeRDNYC (talk) 20:26, 8 October 2024 (UTC)[reply]