Module talk:Portal bar Source: en.wikipedia.org/wiki/Module_talk:Portal_bar
Template:Portal bar is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This is the talk page for discussing improvements to the Portal bar template.
This page is within the scope of WikiProject Portals, a collaborative effort to improve portals on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.PortalsWikipedia:WikiProject PortalsTemplate:WikiProject PortalsPortals
At a quick glance, I'm not sure how to add that class. (Sorry, I'm not much of a coder.) Tell me precisely what you want added and where and I'll do it when I have time. Alternatively, if you can do it yourself, go for it. – Maky« talk »23:01, 16 January 2015 (UTC)[reply]
I propose to edit this template to add a better design. In the French equivalent template fr:Modèle:Portail, the size of the text and the width of the space taken by the text adapts to the number of portals added. The problem here is that if five portals are entered, their names are all squeezed in the smae space as one or two portals. This is a portal promotion measure.
I propose making two changes to the template (via Module:Portal bar):
Add "nomobile" class to the portal bar, to make it not display on mobile WP. This would make it consistent with other navboxes that contain internal links at the bottom of articles.
Only use the word "portal" once, at the beginning of the bar, rather than repeating "portal" for every link. This would make the template more compact, and more consistent with Template:Subject bar.
The text alignment in the Proposed bar doesn't look right, it seems as if the word Portals is middle aligned to its cell and the word Czech Republic is slightly higher (as are the other text labels).
Not repeating the word portal seems like a good idea, I'd want to check with non-English language readers to make sure it doesn't have any weird unintended consequences but it should probably work. -- 109.78.202.228 (talk) 20:49, 11 December 2021 (UTC)[reply]
I'd almost forgotten I'd switched to using Edge (mostly), I'm surprised that there would be any rendering differences from Chrome but fork that. Do we have any click data to show that readers actually use these portals or do they exist because editors like the look of them? (After reading WP:OVERLINK I tend to think repeating very similar links all over the place, like in a portal box or portal bar, is a waste of time, mostly harmless but pointless.) -- 109.78.202.157 (talk) 05:50, 12 December 2021 (UTC)[reply]
@Hike395, Michael Bednarek, and 109.78.202.157: Pardon me—I only just discovered the change. I'd prefer it if the content was still center-aligned within the bar, rather than left-aligned as it is now. It looks odd in the browser window of my (very wide) desktop display (the content of the above examples takes up less than a third of the bar). —DocWatson42 (talk) 06:20, 19 December 2021 (UTC)[reply]
@DocWatson42: Thanks for letting me know. You're right that I was optimizing for the case of smaller screens, which are more common nowadays. If you shrink your window horizontally, you can see how the bar responds to smaller screens. I also made Template:Subject bar call Module:Portal bar, and there were 20,000+ articles where a previous version of portal bar was left-aligned.
I can try and make a center-aligned version in the Sandbox (I'm still a newbie at modern CSS, so it might take me a number of attempts). In the meanwhile, it would be good to come to a consensus about left- versus center-aligned. Maybe left-aligned for small screens and centered for big ones? I like the left-alignment for small screens. I hope other editors will chime in. — hike395 (talk) 06:47, 19 December 2021 (UTC)[reply]
Left-alignment shouldn't matter for smaller windows, as the content compresses over to the left anyway (and then down when the window becomes narrow enough. I took Mr. Bednarek's advice and checked the above examples again.). —DocWatson42 (talk) 07:03, 19 December 2021 (UTC)[reply]
It turns out centering for large screens was quite easy (thanks to justify-content in CSS Flexbox). There's a working version you can look at in Template:Portal bar/testcases: the sandbox version has the centering for screens >768px across. I agree with Doc that this looks better. Any other comments or suggestions? — hike395 (talk) 07:17, 19 December 2021 (UTC)[reply]
@Hike395: I'm sorry I missed this, though I'm replying because I've seen the results, which look good. You've (apparently) even fixed another problem—when portal bars were adjacent to Authority control templates there used to be a space between them, which I no longer see. —DocWatson42 (talk) 04:37, 22 December 2021 (UTC)[reply]
On Iran, I converted an instance of {{Portal}} to {{Portal bar}} (via {{Subject bar}}), and Moxy objected, because {{Portal bar}} did not display on mobile. In response to their feedback, I've turned mobile display back on for {{Portal bar}}.
1 Not a British prince by birth, but created Prince Consort. 2 Not a British prince by birth, but created a Prince of the United Kingdom. Princes whose titles were removed and eligible people who do not use the title are shown in italics.
Antigua and Barbuda, The Bahamas, Belize, Canada, Grenada, Jamaica, Saint Kitts and Nevis, Saint Lucia and Saint Vincent and the Grenadines: Charles III
Oceania
Australia, New Zealand, Papua New Guinea, Solomon Islands and Tuvalu: Charles III
This seems very easy to misread as saying that those fifteen links (Monarchy, Royalty, United Kingdom...) are the "related article" links that Wikipedia is offering the reader. (I moved the portal bar inside the navboxes collection in response to this issue, but I don't know if that's an appropriate fix.)
A reader who doesn't know what a portal is can easily misread this as the blue box being a simple header for the five links below it. In both this and the Charles III case the blue bar has a "show" button, but a reader who believes that they're already looking at the list of articles wouldn't think that they needed to click it.
I definitely see your point. However, MOS:ORDER does currently indicate that {{Portal bar}} should go after the navboxes. If you want to move them somewhere else, we would have to get consensus at MOS:ORDER.
One possibility is to add a bit of whitespace before the Portal bar, if the previous object is a navbox. For example:
It's a bit subtle. You could try bringing the left and right borders in a bit, and/or changing the "Portals:" heading to a full, coloured box on the left of the template to make that the heading. Even that can still be misread in the Charles III example, though, which is unfortunate.
While I understand why this has been done, I have to say, it's quite aesthetically unpleasing and makes an articles bottom section look rather messy. In all honesty, I don't see adequate proof that this was a major source of confusion in the first place. While it theoretically could be, the portal bar has been the same width and length as other templates for years without appearing to cause any issue. Personally, I trust most readers to be intelligent enough to realize that the "show" button will show more links, and the portal bar already looked different enough for readers to notice that they're two separate things. Krisgabwoosh (talk) 16:51, 17 September 2022 (UTC)[reply]
I would trust most web users to understand what the "[show]" button might mean on a plain rectangle offering a title but no other content: that it shows more content.
But under the status quo design, a portal bar immediately below a closed navbox looks a lot like an open navbox, with no suggestion to the user that any content has been obscured, meaning that they have no impetus to look for a way to access that information. I strongly doubt that many web users would be able to anticipate what the "[show]" button would do on a box like that, if they were reading it as a single box with a title and some links. They might interpret it as "show more links" if the button said "[more]", but I don't think they'd get there from "[show]". --Lord Belbury (talk) 19:15, 17 September 2022 (UTC)[reply]
My main issue is that the smaller bar size looks out of place and a bit disjointed under the navboxes. Like a puzzle piece that doesn't quite fit, y'know? Krisgabwoosh (talk) 21:34, 17 September 2022 (UTC)[reply]
Personally, I think it still needs to be demonstrated that this is a major source of confusion. But assuming it is, perhaps the white background could be changed to something more distinguishable. Alternatively, "Portals:", which at present is situated on the left hand side, could be moved to the top middle, almost as a header. Krisgabwoosh (talk) 21:55, 17 September 2022 (UTC)[reply]
I'd agree that the current version is more disjointed, but that doesn't really seem like an obvious negative, to me. Navbox links and portals are very different things, with the MOS emphasising that they aren't interchangeable. But conversely, yes, putting the "Portals:" pseudo-heading at the top would be another solution. Making this template look more like a full navbox, even giving the title bar a background colour, makes it harder to misread as being the second half of the previous navbox.
I'd love to see it demonstrated that the average Wikipedia reader even understands what a collapsed navbox is! That it's a thing they can expand to see links to other articles, rather than just being some kind of category banner where the text in the middle is sometimes clickable. Does Wikipedia have a UI team anywhere who run surveys on that kind of thing? --Lord Belbury (talk) 22:17, 17 September 2022 (UTC)[reply]
I don't know of a UI team that does surveys or tests, so it's up to us editors to guess. I've implemented a version in the sandbox which has "Portals" at 100% font size in the middle of the box as a header, see above. What do editors think of this? (It might look weird if there are only 1 or 2 portals) Does this solve the problem that Lord Belbury brought up? — hike395 (talk) 22:37, 17 September 2022 (UTC)[reply]
I think I like this new version much better. It keeps the portal bar in symmetrical alignment with the navboxes while differentiating the contents of the navbox with those of the portal bar. I'd support this if implemented. Krisgabwoosh (talk) 23:13, 17 September 2022 (UTC)[reply]
I'm not really sure this differentiates it enough; it has the same issue where the closed navbox above it looks like its header, with "Portals" still looking like a subheading within that box. I think the template either needs punching up to the same weight as a navbox (with a solid coloured title, clearly conveying the idea that all of these little boxes at the end of the article have a heading and some content), or to looking nothing like a navbox (which the wider margin seems fine for).
Yes, this was an intentional change to the template. I guess the thread doesn't make much sense when examples get changed retroactively: it was introduced with Hike395's Now there is 1em top/bottom margin and 5em right/left margin. What do editors think? above, and then implemented. --Lord Belbury (talk) 07:18, 18 September 2022 (UTC)[reply]
I don't like the presently implemented change at all. The less than full width portal bar just looks weird, and doesn't really solve the confusion problem. The simple solution to the problem identified at the start of this section is to modify MOS:ORDER to indicate that a (full width) {{Portal bar}} should go before the navboxes, not after them. As the present MOS:ORDER sequence has already now been identified as confusing, it shouldn't be difficult to obtain consensus for such a modification. Bahnfrend (talk) 07:24, 18 September 2022 (UTC)[reply]
There clearly isn't a consensus for the narrower box, so I've reverted to status quo ante.
@Krisgabwoosh: If we turn {{Portal bar}} into a navbox, it will not get displayed on mobile. The current consensus is that Portal links should appear on mobile. If I understand correctly, the filter inside of MediaWiki is on the "navbox" class itself. We would have to copy the entire navbox CSS class into another class, and then maintain the two to be identical. That sounds like a lot of maintenance.
From this discussion, I don't think there's an easy visual method that distinguishes the portal box from the previous navbox and is acceptable to many editors. I will take Bahnfrend's advice and start a discussion to change MOS:ORDER. I will ping everyone on this discussion over there.
This template has for many years included a clear warning "This template does not belong in the "See also" section" but many editor seem completely oblivious to this bit of documentation.
Can any of the programming experts come up with a suitable regex incantation or other magic spell to create an error category for cases where template Portal bar has incorrectly been inserted under the See also section? C'mon programmers, I bet you can do it. -- 109.76.134.214 (talk) 19:57, 21 May 2025 (UTC)[reply]