Module talk:Sidebar: Difference between revisions

Content deleted Content added
Sardanaphalus (talk | contribs)
m Archiving 1 discussion(s) to Module talk:Sidebar/Archive 7) (bot
(647 intermediate revisions by 86 users not shown)
Line 1:
{{ user:MiszaBot/config
{{talkheader}}
| maxarchivesize = 31K
| minthreadsleft = 4
| minthreadstoarchive = 1
| counter = 7
| algo = old(90d)
| archive = Module talk:Sidebar/Archive %(counter)d
}}
{{copied|from=Module:Sidebar|from_oldid=816157517|to=:incubator:Module:Wp/nod/Sidebar|to_diff=4304026}}
{{to do |inner=
* [[/Archive 5#Nomobile use]]
* [[/Archive 5#Make tables into divs instead|#Make tables into divs instead]]
* [[/Archive 5#Width auto and similar sidebars]]
}}
{{archives|search=yes|bot=MiszaBot II|age=90}}
{{Lua sidebar}}
 
== Should there be a way to automatically open up the relevant section of the sidebar? ==
==Glitch==
I am aware of the glitch in folowing articles. Working on it... --[[User:Coolcat|Cool Cat]] [[User talk:Coolcat|<sup>My Talk</sup>]] 13:40, 15 July 2005 (UTC)
* <s>[[G3 Free Trade Agreement]]</s>
* <s>[[G8]]</s>
* <s>[[The Troubles]]</s>
 
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)
:Fixed... kida. There is a big chunk of white space tho... :) --[[User:Coolcat|Cool Cat]] [[User talk:Coolcat|<sup>My Talk</sup>]] 13:51, 15 July 2005 (UTC)
 
== How get "alt" text for the image ==
==Text size==
How would I make a sidebar with the text one size up from the current Sidebar template? [[User:Rd232|Rd232]] 08:47, 22 July 2005 (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)
==Hmm==
:{{replyto|Noleander}} [[Template:Nadir of American race relations]] has <syntaxhighlight lang=wikitext>{{Sidebar with collapsible lists
This seems to be getting used a lot for text that would be better off being integrated into the main text as a section or subsection. While this is an engaging layout tactic style in magazines and textbooks etc, I don't think it's useful for an encyclopedia article. [[User:Matt Crypto|&mdash; Matt <small>Crypto</small>]] 11:17, 31 March 2006 (UTC)
...
| image = [[File:Le Petit Journal 7 Oct 1906 (cropped).jpg|232px|class=notpageimage]]
...
}}</syntaxhighlight> and you would add the alt text inside that image specification using {{para|alt}}, see [[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]]) 12:57, 10 May 2025 (UTC)
::Great, thanks, that worked. [[User:Noleander|Noleander]] ([[User talk:Noleander|talk]]) 13:13, 10 May 2025 (UTC)
 
== PleaseTitle documentalways this templatelink-blue? ==
 
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 can't find this template under [[Wikipedia:Template messages]] -- it needs to be there so people know about it. (If it's already there and I missed it, please feel free to break a piano over my head.) Also, it could do with being put into an appropriate template category. — [[User:Johantheghost|Johan&nbsp;the&nbsp;Ghost]]&nbsp;[[User talk:Johantheghost|<sub>seance</sub>]] 09:58, 27 April 2006 (UTC)
 
My Lua knowledge is limited at best so I have no idea what/who (and, by extension, why) caused this. Any thoughts?
== Current status of template, and suggestions ==
 
&mdash;&hairsp;[[User:DaZyzzogetonsGotDaLastWord|Daℤyzzos]] ([[User_talk:DaZyzzogetonsGotDaLastWord|✉️]]&nbsp;•&nbsp;[[Special:Contributions/DaZyzzogetonsGotDaLastWord|📤]]) 20:18, 29 July 2025 (UTC)
So the template has been overhauled. That's a good idea, and I look forward to using it in future. I've got a few comments about the current direction:
:{{replyto|DaZyzzogetonsGotDaLastWord}} On which page do you see this happening? Examples ''always'' help. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 21:03, 29 July 2025 (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>
:::This also occurs using Firefox, again dark mode only. The HTML that is served has <syntaxhighlight lang=html><table class="sidebar nomobile nowraplinks hlist">
<tbody>
<tr>
<td class="sidebar-pretitle">Part of a series on</td>
</tr>
<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)
 
== Removing sidebar images as page image ==
# The code currently uses the author's (IMO) excessively idiosyncratic syntax styling. This makes it rather difficult for other users to work on it. I'd really rather that the template adopted a more minimal approach, such as by stripping out the lavish embellishment of comment tags.
# The default width doesn't match that of {{tl|infobox}}. This makes stacking sidebars and infoboxen look less neat.
# The parameter names are subtly different from {{tl|infobox}} / {{tl|navbox}} too. This makes it harder to pick the template up.
 
(continuation of [[Module_talk:Sidebar/Archive_6#Removing_sidebar_images_as_page_image|Module talk:Sidebar/Archive 6#Removing sidebar images as page image]])
Thoughts? [[user:thumperward|Chris Cunningham (not at work)]] - [[user talk:thumperward|talk]] 11:13, 28 October 2008 (UTC)
 
@[[User:Izno|Izno]]: I've added <code>notpageimage</code> to the [[Template:Sidebar/sandbox|sandbox]] and [[Module:Sidebar/configuration/sandbox|its configuration]]. [[User:The RedBurn|The RedBurn]] <small>([[User Talk:The RedBurn|ϕ]])</small> 06:36, 30 August 2025 (UTC)
:# Well, the "excessively idiosyncratic" styling is a consequence of my awareness of the differences between sidebars that use dividing lines, no dividing lines but headings with backgrounds, or nothing to indicate each section in a sidebar. I've been wondering whether it's worth setting up some default stylings within the Sidebar code to reflect this, i.e. something like <code style="font-size:95%;">sectstyle = divider-lines</code> or <code style="font-size:95%;">= heading-backgrounds</code> or <code style="font-size:95%;">= none</code>. I imagine that might make the code more modular, i.e. easier to edit -- although most I also imagine most editors wouldn't want to edit the code itself but use the various styling parameters available.
:# I haven't checked, but I don't think there is a default width..?
:# Unintentional, so probably worth tweaking ("correcting"), although they were created with Navbox and its like in mind.
::[[User:Sardanaphalus|Sardanaphalus]] ([[User talk:Sardanaphalus|talk]]) 13:00, 28 October 2008 (UTC)
 
::# I wasn't actually referring to the ''styling'', but to the layout of the code itself: about a 30% overhead in whitespace, comment lines and indenting. by and large, WP code isn't indented, there are rules to when line breaks can be used without bleeding through to the output, and a comment line like <br /><tt>------------------------------- topimage --------------------------------</tt><br /> doesn't really tell any reader who is capable of parsing the code anything that they wouldn't be able to see themselves. I didn't want to remove this, but nor do I think keeping it is likely to attract others to edit it.
::# That's part of the problem. Editors shouldn't be expected to know to have to put <tt>width=22em</tt> if they want a sidebar to fit flush with infoboxen. Sensible defaults ''should'' be specified, even if the ability to override them is included.
::# See, for instance, "heading" versus "header", for instance, and the different definition of "title".
:: [[user:thumperward|Chris Cunningham (not at work)]] - [[user talk:thumperward|talk]] 13:13, 28 October 2008 (UTC)
 
:::# Well, I find them useful (here and in other template code) as they make it easier to identify chunks of code quickly, especially when coming back to it after some time. I guess they're the coding equivalent of headings in sidebars themselves -- or, in your ideal world, would you want to be rid of those as well?
:::# I think there's a fair number of sidebars where 22.0em would be too wide, e.g. to point to one I've seen recently, {{tl|Culture of Poland sidebar}}. How about mentioning this default in the documentation and/or placing <code style="95%;"><nowiki><!--Use "width:22.0em;" to match default infobox width--></nowiki></code> next to the <code style="95%;">|style = </code> entry in the "Full blank syntax" section, or in a separate section of its own?
:::# My understanding is that "header" applies only to items at the top of a page/template/document/etc, whereas "heading" doesn't; hence "heading"s here as they can appear throughout the template. Not sure how "title" differs from its {{tl|Navbox}} use..?
:::[[User:Sardanaphalus|Sardanaphalus]] ([[User talk:Sardanaphalus|talk]]) 14:45, 28 October 2008 (UTC)