Module talk:Sidebar: Difference between revisions

Content deleted Content added
Add support for V T E: we don't need that, and it breaks the rest of the page
m Archiving 1 discussion(s) to Module talk:Sidebar/Archive 6) (bot
 
(37 intermediate revisions by 13 users not shown)
Line 16:
{{Lua sidebar}}
 
== Option to omit nomobile? ==
== Support for plainlist TemplateStyles and mobile disappearing styles ==
 
{{ping|Izno}} At [[Module talk:Sidebar/Archive 6#How to override "class=nomobile" to display sidebar in mobile view?]] you said "This cannot be overridden and that will not change". Did you only mean that there is no way to override an existing <code>class=nomobile</code>, or did you rule out adding a new sidebar option like <code>mobile=yes</code> to omit <code>class=nomobile</code>? I came from a discussion about {{tl|NGC objects}} at [[Wikipedia:Templates for discussion/Log/2025 January 4#Template:NGC objects]]. A long list is split into intervals so the articles are closer tied together than normal sidebars and this sidebar is very narrow. I think an option to omit nomobile would sometimes be nice. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 16:45, 4 January 2025 (UTC)
I've made some changes to the module sandbox here that reflect changes made to [[Module:Navbox/sandbox]] and which I've started a discussion at [[Template talk:Navbox#TemplateStyles for plainlist]]. These changes are describe in parts 1 and 2 there. If you have questions, please feel free to discuss there. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 23:40, 16 December 2022 (UTC)
 
:Ruling both out. I can reinstate <code>vertical-navbox</code> if we prefer just to make it more opaque ;). It's not about how narrow or wide sidebars are, it's about how much HTML they dump into the page that isn't used in mobile. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 20:19, 4 January 2025 (UTC)
:Hi, [[User:Izno|Izno]]. Thank you for your work on the CSS/TemplateStyles refactoring. Are edits such as [[Special:Diff/1157915259]] useful with regards of this effort?
:Which maybe doesn't make my true preference clear of course - which is that everything is displayed at all resolutions (or at least until this module is deleted, which is probably my truest preference, for various reasons). What I'm doing is respecting the WMF's choice to remove these elements from mobile. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 20:22, 4 January 2025 (UTC)
:I see that [[Module:Sidebar]] has [[Special:Diff/1128569472|support for adding the TemplateStyles based on parameters]] ({{para|contentclass}} in the case of {{tl|Atomic radius}}). Will function <code>add_list_styles</code> be eventually removed from [[Module:Sidebar]] (assuming all relevant places are replaced with explicit calls to {{tl|plainlist}} et al.)? Or is <code>add_list_styles</code> and related code for adding TemplateStyles expected to be left in the module "forever"? —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 19:57, 31 May 2023 (UTC)
::@[[User:Andrybak|Andrybak]], it's probably not much of a win, if a win at all, today, to make swaps like that. I did do that for a few sidebars several years ago, but having to deal with the hundreds of thousands of navigation templates (Module:Sidebar and [[Module:Navbox]], and [[Module:Infobox]] too) made it not a winning strategy to me when there are other [[MediaWiki talk:Common.css/to do|much larger gains to be had]]. Right now, if there is a loss, it's that the addition of plainlist/hlist styles to a page would become slightly less deterministic. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 19:59, 31 May 2023 (UTC)
:::I'm confused. I think I don't understand the layout/formatting of the page [[MediaWiki talk:Common.css/to do]]. For example, {{tl|Infobox Cyrillic letter}} [[Special:Diff/1157920522|was still listed]] for plainlist. However, [[Special:Diff/1157920338]] seems very similar to the aforementioned [[Special:Diff/1157915259]]. What am I missing? —⁠[[User:Andrybak|andrybak]] ([[User talk:Andrybak|talk]]) 20:22, 31 May 2023 (UTC)
::::My link to the to do page was to indicate there is higher-value work to be done on other things than the pretty-mechanical/low-value change that adds plainlist/hlist templates and eventually removes the checking code from the module.
::::Your infobox cyrillic letter change looks fine (though now-reverted and a full page protection on top of that unrelated to your efforts). There are more painful conversions for infoboxes which is why I added the checking code in Module:Infobox as well (think: it is trivial to make an infobox where the row disappears with a basic parameter and a class in the row class rather than putting an if block in with a template).
::::The parts of the to do list that should be worked are the ones not under the "done" section. :) [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 07:40, 1 June 2023 (UTC)
 
== Should there be a way to automatically open up the relevant section of the sidebar? ==
== Sidebar missing in mobile view ==
 
After [[Template:Feminism sidebar]] got reorganized, a bunch of transclusions no longer automatically expand the correct section. For example, the article [[Feminist theory in composition studies]] automatically expands the "Concepts" section even though the article is now listed under the "Theory" section. Something I realized is that expanding the section ''that contains a link to the current article'' might be something that could be done automatically, so that editors no longer have to manually specify the section to auto-expand on every article where a sidebar is included. [[User:PBZE|PBZE]] ([[User talk:PBZE|talk]]) 19:39, 27 January 2025 (UTC)
<nowiki>{{LGBT sidebar}}</nowiki>: Refer [[GaLTaS]], where the sidebar displays only in Desktop view on iPad and iPhone. [[User:Chrisdevelop|Chrisdevelop]] ([[User talk:Chrisdevelop|talk]]) 23:48, 29 November 2023 (UTC)
 
== How get "alt" text for the image ==
:[[Template:Sidebar]] says: "This template does not display in the mobile view of Wikipedia; it is desktop only. Read the documentation for an explanation."
:and <nowiki>"Templates using the classes class=navbox ({{navbox}}) or class=nomobile ({{sidebar}}) are not displayed on the mobile web site of English Wikipedia. Mobile page views account for approximately 65% of all page views (90-day average as of May 2023)."</nowiki> [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 01:40, 30 November 2023 (UTC)
::Thanks for your speedy reply and explanation. I copied the Sidebar from another similar site and didn’t see any documentation there. Where can I read this documentation? Given that most viewers are using mobile view, and therefore won’t see the Template unless they switch to Desktop view, is there either a way to edit this to display in all situations, or is there another Sidebar template that already will? [[User:Chrisdevelop|Chrisdevelop]] ([[User talk:Chrisdevelop|talk]]) 01:55, 30 November 2023 (UTC)
:::IDK, I came here to try to figure out what the deal is. AFAICT, the sidebar is not implemented correctly on mobile plus some think that dropping the sidebar content altogether is good because it reduces page weight and thus load time. I suppose these folks grew up in the 2000s. I could not find any more info. I tried asking on [[Wikipedia:Village_pump_(technical)#Template_sidebar_design_alternative?]] but got crickets. [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 02:40, 30 November 2023 (UTC)
::::Thanks for all your trouble. I’ll keep an eye on the Village Pump and check back here every so often. I like this particular LGBT project sidebar because if saves a lot of time to not have to enter its directory manually. Is there a place where the Sidebar itself can be edited? That was how I ended up here in the first place. [[User:Chrisdevelop|Chrisdevelop]] ([[User talk:Chrisdevelop|talk]]) 02:48, 30 November 2023 (UTC)
:::::By "the Sidebar" do you mean "The page [[GaLTaS]] has a sidebar and I want to change its content?
:::::If yes edit the intro and see
:::::<nowiki>{{LGBT sidebar}}</nowiki>
:::::This template contains the config for the sidebar. Navigate to the config file by putting "Template:" in Wikipedia search bar followed by the name of the template: [[Template:LGBT_sidebar]]. Edit that page to change the template.
:::::'''BEWARE''' any change you make affects '''all''' pages using that sidebar. You should discuss any changes on the [[Template_talk:LGBT]] page, or better ask someone else to do the edits the first time. [[User:Johnjbarton|Johnjbarton]] ([[User talk:Johnjbarton|talk]]) 03:03, 30 November 2023 (UTC)
::::::Brilliant, thank you - exactly what I needed to know; and yes, I will take your advice re editing this. [[User:Chrisdevelop|Chrisdevelop]] ([[User talk:Chrisdevelop|talk]]) 03:28, 30 November 2023 (UTC)
 
In article [[Atlanta Compromise]], it is using an InfoBox [[Template:Nadir of American race relations]] .. that infobox has an image in it. How can I add "alt" text for the image, to assist visually impaired users of the encyclopedia? I couldn't find instructions for alt text in this module page. [[User:Noleander|Noleander]] ([[User talk:Noleander|talk]]) 01:39, 10 May 2025 (UTC)
== Hide image ==
:{{replyto|Noleander}} [[Template:Nadir of American race relations]] has <syntaxhighlight lang=wikitext>{{Sidebar with collapsible lists
...
| image = [[File:Le Petit Journal 7 Oct 1906 (cropped).jpg|232px|class=notpageimage]]
...
:{{replyto|Qwerty284651}}</syntaxhighlight> It'sand calledyou awould navbar,add andthe it'salt alreadytext present.inside Whythat doimage youspecification thinkusing that{{para|alt}}, itsee isn't?[[WP:EIS#Alt text and caption]]. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 1512:3757, 510 JuneMay 20242025 (UTC)
::Great, thanks, that worked. [[User:Noleander|Noleander]] ([[User talk:Noleander|talk]]) 13:13, 10 May 2025 (UTC)
 
== Title always link-blue? ==
Hi. I'd like to hide the image in {{tlx|IPCC}}, when it's invoked in [[IPCC]], which already has the same image in {{tlx|infobox organization}}. I've tried <code><nowiki>content1 = {{IPCC|child=yes}}</nowiki></code> but it didn't work. Does anybody know if that's possible? Otherwise, it might be better to remove the sidebar from that article. Thanks! [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 15:22, 21 January 2024 (UTC)
 
I noticed that when a wrapper of this template is called on the page the title parameter links to, the title renders as the link color despite not actually being a link. This doesn't align with the default behavior when a page links to itself (e.g.: [[{{FULLPAGENAME}}]]) or the behavior when a non-title link in a sidebar links to the page it's placed on. It's also ''possible'' that this violates the {{tq|Links should be clearly identifiable as links for readers}} clause of [[MOS:COLOR]] (it doesn't conform to the inverse, i.e. that non-links shouldn't appear as links).
I've noticed [[Longitude]] invokes [[Template:Geodesy]] with parameter "notshowfig=1" which seems to be ignored. [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 05:18, 4 February 2024 (UTC)
 
My Lua knowledge is limited at best so I have no idea what/who (and, by extension, why) caused this. Any thoughts?
Here's another example where the sidebar image duplicates the lead image: [[Light cone]]. [[User:Fgnievinski|fgnievinski]] ([[User talk:Fgnievinski|talk]]) 05:19, 4 February 2024 (UTC)
 
&mdash;&hairsp;[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 20:18, 29 July 2025 (UTC)
== Add support for V T E ==
:::Same{{replyto|DaZyzzogetonsGotDaLastWord}} answer,On samewhich question. It's already present in [[Template:Sidebar]], so, whypage do you thinksee thatthis it isn'thappening? IfExamples something isn't working as expected. you 'always'need'' to provide exampleshelp. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 1821:1603, 529 JuneJuly 20242025 (UTC)
 
::First noticed it on [[Mathematics]].{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 23:22, 29 July 2025 (UTC) <ins>P.S. Just realized this&mdash;only happens on dark mode (probably should've checked that earlier, but oh well.) Also: using Chrome but also shows up in Safari on my phone (again only in dark mode).{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 23:28, 29 July 2025 (UTC)</ins>
Can you add support for V T E <code><nowiki>{{navbar|Template Name|mini=y}}</nowiki></code> in the bottom right corner of this template like many other templates have? [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 02:32, 5 June 2024 (UTC)
:::This also occurs using Firefox, again dark mode only. The HTML that is served has <syntaxhighlight lang=html><table class="sidebar nomobile nowraplinks hlist">
:{{replyto|Qwerty284651}} It's called a navbar, and it's already present. Why do you think that it isn't? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 15:37, 5 June 2024 (UTC)
<tbody>
::I meant to add to the {{tl|sidebar}} template the ability display VTE i.e. the <code><nowiki>{{navbar|Template Name|mini=y}}</nowiki></code>. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 16:28, 5 June 2024 (UTC)
<tr>
:::Same answer, same question. It's already present in [[Template:Sidebar]], so, why do you think that it isn't? If something isn't working as expected. you ''need'' to provide examples. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 18:16, 5 June 2024 (UTC)
<td class="sidebar-pretitle">Part of a series on</td>
::::I don't see VTE in {{tl|Tennis tournaments}}. [[User:Qwerty284651|Qwerty284651]] ([[User talk:Qwerty284651|talk]]) 18:22, 5 June 2024 (UTC)
</tr>
:::::You need a {{para|name}} parameter, {{diff|Template:Tennis tournaments|prev|1227452320|like this}}. It is documented, at [[Template:Sidebar#Parameters]], particularly in the paragraph before the table. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 20:19, 5 June 2024 (UTC)
<tr>
<th class="sidebar-title-with-pretitle">
<a class="mw-selflink selflink">Mathematics</a>
</th>
</tr>
...
</tbody>
</table></syntaxhighlight> In both dark and light mode, this comes with the following CSS: <syntaxhighlight lang=css>@media screen {
a.mw-selflink {
color: inherit;
font-weight: bold;
text-decoration: inherit;
}
}</syntaxhighlight> which is what makes the word "Mathematics" appear black and boldface. But in dark mode only, the following CSS (found in [[Module:Sidebar/styles.css]]) is used in addition: <syntaxhighlight lang=css>@media screen {
html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a {
color: var(--color-progressive) !important;
}
}</syntaxhighlight> The last three simple selectors (<code>.sidebar:not(.notheme) .sidebar-title-with-pretitle a</code>) are what's causing the color to be overridden. The color value (<code>var(--color-progressive)</code>) is read from a variable that is set elsewhere. Why it's written that way, I don't know. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 07:10, 30 July 2025 (UTC)
::::I did some [[WP:WikiBlame|WikiBlame]]-ing and discovered that the last bit of CSS in your comment (the <code>@media screen</code> one) was added in [[Special:Diff/1234103998|this edit]] to the style page by @[[User:Jdlrobson|Jdlrobson]] (pinging to find the reasons for the addition as the link in the edit summary is broken and a search for "Fall of Constantinople dark mode error" on talk pages turned up blank).{{snd}}[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 13:20, 30 July 2025 (UTC)