Template talk:Portal bar#Version without Module:Navbox
{{Permanently protected}}
{{Talk header}}
{{WikiProject banner shell|
{{WikiProject Portals}}
}}
{{Tfd end|date=2011 July 2|result=keep}}
{{User:MiszaBot/config
| algo=old(365d)
| archive=Template talk:Portal bar/Archive %(counter)d
| counter=1
| maxarchivesize=75K
| archiveheader={{Automatic archive navigator}}
| minthreadsleft=7
| minthreadstoarchive=2
}}
noviewer class so Media Viewer skip Portal Bar's images
I noticed that when using the Media Viewer to browse an article's images (e.g. those in Charlize Theron#See also) that the images in the Portal bar appear. This seems highly undesirable. There is a special class ("noviewer") that can used to have Media Viewer skip images, see Wikipedia talk:Media Viewer#Some images need to be excluded). Seems like a good idea for this template to use it. Jason Quinn (talk) 22:13, 16 January 2015 (UTC)
: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)
Design
Hi,
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.
--Railfan01 (talk) 07:28, 12 May 2018 (UTC)
:{{Done}} (see below) — hike395 (talk) 14:57, 20 December 2021 (UTC)
Proposed change to template
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.
I've coded up these changes in Module:Portal bar/sandbox and Module:Portal bar/sandbox/styles.css. To demonstrate the proposal, here is a before/after:
;Current
{{Portal bar|Prague|Czech Republic|Slovakia|NATO|European Union|Europe|Geography}}
;Proposed
{{Portal bar/sandbox|Prague|Czech Republic|Slovakia|NATO|European Union|Europe|Geography}}
You can see other examples at Template:Portal bar/testcases (the sandbox version has the proposed change).
What do other editors think of the proposed change? Suggestions to make the template better are more than welcome! — hike395 (talk) 13:39, 5 December 2021 (UTC)
:I think the more compact design is an improvement, as is the slightly reduced icon size. -- Michael Bednarek (talk) 14:47, 11 December 2021 (UTC)
:: 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)
:::I see (Chrome, Firefox) a slight misalignment the other way: the word "Portals:" seems a little bit higher than the icons and portal names. -- Michael Bednarek (talk) 02:04, 12 December 2021 (UTC)
:::: 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)
{{od|4}} {{ping|Michael Bednarek|109.78.202.157}} I've reimplemented the layout using CSS Flexbox. I've attempted to make the baselines of all of the text strings line up vertically. Does this look good to you? (see above). — hike395 (talk) 17:39, 17 December 2021 (UTC)
:As I wrote before, I think the changes are an improvement, and I can't see any alignment issues now. -- Michael Bednarek (talk) 03:29, 18 December 2021 (UTC)
::{{Done}} Thanks for checking! Upgraded the main template now. — hike395 (talk) 07:56, 18 December 2021 (UTC)
{{Ping|hike395|Michael Bednarek|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)
:{{ping|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.
:: You're welcome. ^_^ —DocWatson42 (talk) 07:03, 19 December 2021 (UTC)
: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)
:: 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)
:::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)
::::Later: figured out centering on the small-screen version, too. That's now live in the sandbox. {{ping|DocWatson42|Michael Bednarek}} what do you think? — hike395 (talk) 07:59, 19 December 2021 (UTC)
:::::Fine. I suppose having the content centred is a less severe change from the old format, so that shouldn't ruffle too many feathers. -- Michael Bednarek (talk) 10:42, 19 December 2021 (UTC)
::::::{{Done}} I promoted the sandbox CSS file to main. — hike395 (talk) 14:29, 19 December 2021 (UTC)
::::::: {{Ping|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)
::::::::Yes, both {{tl|Portal bar}} and {{tl|Sister bar}} will now abut to all navboxes, and to each other. Let me know if you see any other odd spacing issues with them. — hike395 (talk) 05:32, 22 December 2021 (UTC)
=Display on mobile?=
On Iran, I converted an instance of {{tl|Portal}} to {{tl|Portal bar}} (via {{tl|Subject bar}}), and {{U|Moxy}} objected, because {{tl|Portal bar}} did not display on mobile. In response to their feedback, I've turned mobile display back on for {{tl|Portal bar}}.
Is there a consensus for whether {{tl|Portal bar}} should display on mobile? What do other editors think? — hike395 (talk) 14:43, 20 December 2021 (UTC)
: {{Ping|hike395}} I'd like it. IMHO all content should be displayed in mobile mode (e.g. navbars, which are also currently invisible). —DocWatson42 (talk) 04:37, 22 December 2021 (UTC)
::I gather that the mobile display for {{tl|Portal}} just got turned on, too, so that seems to be the trend. — hike395 (talk) 05:29, 22 December 2021 (UTC)
"Template:Prb" listed at [[Wikipedia:Redirects for discussion|Redirects for discussion]]
An editor has identified a potential problem with the redirect :Template:Prb and has thus listed it for discussion. This discussion will occur at Wikipedia:Redirects for discussion/Log/2022 January 5#Template:Prb until a consensus is reached, and readers of this page are welcome to contribute to the discussion. MB 15:38, 5 January 2022 (UTC)
Discussion of where to place this template
A discussion of where to place {{tl|Portal bar}} on articles is now open at WT:MOSLAYOUT. Please feel free to join the discussion! — hike395 (talk) 19:41, 18 September 2022 (UTC)
Do not put in "See also" section
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)
:Try [https://en.wikipedia.org/w/index.php?search=insource%3A%2FSee+also%5Cs*%5C%3D%5C%3D%5C%3D*%5B%5E%5C%3D%5D%2B%5C%7B%5C%7B%5BPp%5Dortal+bar%2F&title=Special%3ASearch&profile=advanced&fulltext=1&ns0=1 this], although it times out. — hike395 (talk) 11:43, 22 May 2025 (UTC)