Template talk:Myprefs

(Redirected from Template talk:Myprefs/section/doc)
Latest comment: 2 months ago by Andrybak in topic Rename to Template:Preferences?

Linking to sections within tabs

edit

I've sandboxed up the code which should be needed in order to jump to specific sections on each tab, but it seems to only work for sections within the first (User profile) tab, see Template:Myprefs/testcases. For sections on any other tab, it resolutely jumps to the top of the User profile tab. --Redrose64 (talk) 19:02, 17 October 2011 (UTC)Reply

Links like Special:Preferences#mw-htmlform-displaywatchlist are not supposed to work. The code at mediawiki.special.preferences.js can switch to the specified section (tab) but not to some-id-inside-section (which is theoretically possible to do). — AlexSm 19:33, 17 October 2011 (UTC)Reply
It would seem that since 2011, linking to sections within tabs is now possible. I went slightly different route, through a subpage/subtemplate: Special:Diff/1234233319/1234235888. The role of subpage is played by Template:X4, as of Special:Diff/1234244630. This wasn't manually crafted, but rather generated by a userscript.
The section names in {{X4}} are also internationalized using Help:System message. Add uselang=qqx to the URL to see them, i.e. Special:Preferences?uselang=qqx. Correspondingly, I also propose adding internationalization to the first link and the tab names: Special:Diff/1234235888/1234247480. To see the effect, see testcases with uselang=qqx or with uselang=de (German), for example.
Alex Smotrov and Redrose64, what do you think? —⁠andrybak (talk) 10:35, 13 July 2024 (UTC)Reply
linking to sections within tabs is now possible – this was implemented in phab:T321330 and later fixed in phab:T330538. Special thanks to Samwalton9 (WMF), Ammarpad, Matma Rex, and Jsn.sherman. —⁠andrybak (talk) 11:11, 13 July 2024 (UTC)Reply
OK. Where did I go wrong here? --Redrose64 🌹 (talk) 12:04, 13 July 2024 (UTC)Reply
#ooui-50 is an individual checkbox. The implementation in resources/src/mediawiki.special.preferences.ooui/nav.js supports only tabs and sections inside tabs, which are held in HTML tags <fieldset>. In this example, <fieldset id="mw-prefsection-echo-echosubscriptions" ...> and thus Special:Preferences#mw-prefsection-echo-echosubscriptions works. I added this example to testcases#Notifications (qqx, de). —⁠andrybak (talk) 12:19, 13 July 2024 (UTC)Reply
Side note: links Special:Preferences#mw-input-wpfancysig and Special:Preferences#ooui-php-39 kinda work, because this checkbox ("Treat the [signature] as wiki markup") is on the first tab, which is opened by default, when opening Special:Preferences. —⁠andrybak (talk) 12:22, 13 July 2024 (UTC)Reply
I've inlined {{X4}} because the sandbox is cleaned by bots, but I still think that a subpage (e.g. Template:Myprefs/sections) would be better for readability. —⁠andrybak (talk) 12:50, 13 July 2024 (UTC)Reply
Created Template:Myprefs/section. Used only in sandbox for now. —⁠andrybak (talk) 08:12, 16 July 2024 (UTC)Reply
Implemented in Special:Diff/1235305838. —⁠andrybak (talk) 21:24, 18 July 2024 (UTC)Reply
Please don't use the #ooui-NNN id-s for linking. They are sequentially assigned to elements on the page (if they don't have an id otherwise, but one is needed for technical reasons, e.g. to associate accessible labels with form fields [1]), and they will change if anything is added, removed or re-ordered. Matma Rex talk 18:38, 14 July 2024 (UTC)Reply
@Andrybak Thanks, although I have to redirect the credit to someone else – the feature was originally implemented by someone known as Scimonster in 2015: [2] (it evolved a lot since then). Matma Rex talk 18:52, 14 July 2024 (UTC)Reply

supports only tabs and sections inside tabs – turns out I was completely wrong, it is possible to link to individual checkboxes/toggles/etc, but not with the ooui-XX IDs. Examples:

Special:Preferences#mw-input-wpshowhiddencats Preferences → Appearance → Advanced options →   Show hidden categories (found in Template:Hidden category)
Special:Preferences#mw-input-wpvector-font-size Preferences → Appearance → Skin preferences = Text = Small
Special:Preferences#mw-input-wpforceeditsummary Preferences → Editing → Editor →   Prompt me when entering a blank edit summary (or the default undo summary)
Special:Preferences#mw-input-wpgadget-edittop Preferences → Gadgets → Appearance →   Add an [edit] link for the lead section of a page

—⁠andrybak (talk) 12:58, 28 July 2024 (UTC)Reply

Check= parameter

edit

Technical 13, I'm really not sure what the purpose is... If I do {{Myprefs|1|Diffs|check=NotAnAbbreviation}}, it come out as Preferences → Appearance → Diffs →   NotAnAbbreviation. Surely that can't be right? -- [[User:Edokter]] {{talk}} 18:46, 24 January 2015 (UTC)Reply

  • You're misusing the parameter. It's suppose to be a visual representation of exactly what the user should be looking for. So, a valid example would be:
Preferences → Appearance → Diffs →   Do not show page content below diffs
Preferences → Appearance → Diffs →   Omit diff after performing a rollback
That way people who have no idea at all, can see okay, click here, then there (or start here), then look for this text and then there should be a checkbox with blah wording and the box should be (un)checked like in the example. — {{U|Technical 13}} (etc) 18:58, 24 January 2015 (UTC)Reply
Edokter ping... PS, I wouldn't object to moving the abbr to the checkbox itself and using css to get rid of the dotted underline. I'd not use the abbr at all if the Phab: ticket on the issue was fixed. — {{U|Technical 13}} (etc) 19:03, 24 January 2015 (UTC)Reply
Now it's a bit clear, in which case the <abbr> isn't needed at all; you can set an |alt= parameter for the image. Which phab ticket are you referring to? -- [[User:Edokter]] {{talk}} 19:26, 24 January 2015 (UTC)Reply
  • |alt= is set... The phab ticket (which I can't seem to find at the moment, I've been hunting) was to fix it so that alt text was applied as title when the image exists. — {{U|Technical 13}} (etc) 19:44, 24 January 2015 (UTC)Reply
Made the above change and updated docs. — {{U|Technical 13}} (etc) 19:50, 24 January 2015 (UTC)Reply
Alt and title serve two completely different purposes. Why are you utilizing <abbr>? If for screenreaders, then |alt= is your guy. -- [[User:Edokter]] {{talk}} 22:22, 24 January 2015 (UTC)Reply
  • Alt doesn't work.   (nothing on mouseover with |alt=check|link=)   (url to image location in bottom left corner on mouseover with |alt=check)   (tooltip on mouseover with <abbr>...</abbr>) — {{U|Technical 13}} (etc) 22:39, 24 January 2015 (UTC)Reply
Oh, you want a tooltip! Just use the image caption. -- [[User:Edokter]] {{talk}} 22:47, 24 January 2015 (UTC)Reply
  apparently now works, it didn't use to. Maybe I couldn't find the ticket because it was already fixed. — {{U|Technical 13}} (etc) 22:49, 24 January 2015 (UTC)Reply
I think that was fixed over a year ago. Closest I could find is phab:T45836. -- [[User:Edokter]] {{talk}} 23:02, 24 January 2015 (UTC)Reply

New Banners tab

edit

With the addition of the Banners tab, could a number be designated to it for the first parameter? It'd make it easier to point people to disabling the fundraising banner. —Tenryuu 🐲 ( 💬 • 📝 ) 04:23, 8 December 2021 (UTC)Reply

Please apply this edit. Afterward, please also append the following to the first table at Template:Myprefs/doc#Parameters so that the documentation is immediately up-to-date:
|-
| Banners || {{myprefs|Banners}}
Thank you. Rummskartoffel 22:36, 14 December 2021 (UTC)Reply
  Done Nardog (talk) 22:41, 14 December 2021 (UTC)Reply

Avoid line breaks between checkbox and text

edit

Allowing line breaks (wrapping) to occur between the checkbox and associated text occasionally makes this template have a confusing output. To fix this, please wrap both the [[File:U+2610.svg|alt=uncheck|link=|uncheck]] {{{uncheck}}} and [[File:Check mark.svg|alt=check|link=|check]] {{{check}}} blocks in line-break-preventing spans (<span style="white-space: nowrap;"> and </span>). --Yair rand (talk) 01:55, 23 December 2021 (UTC)Reply

Not sure if this is that simple. Your suggestion would make the entire input in |check= unwrapped, which could result in unwieldy layout when it's long. (And &nbsp; doesn't work after an image.) Nardog (talk) 02:49, 23 December 2021 (UTC)Reply
Are there any parameter texts that are long enough that this would be a problem? --Yair rand (talk) 17:50, 23 December 2021 (UTC)Reply
Most, I bet. Try squeezing your browser window and see how this paragraph looks. Preferences → Recent changes →   Show the difference between the accepted and latest revisions when viewing the latest pending revision. Nardog (talk) 05:33, 26 December 2021 (UTC)Reply
  Done with {{nowrap}} and {{wrap}}. Nardog (talk) 06:08, 26 December 2021 (UTC)Reply

Why the serif font? It looks odd at H:MW#See also.

edit

Here: style="font-family: Georgia, serif;"
Does MOS:FONTFAMILY not apply to help pages?

Font families should not be explicitly defined in an article, with the exception of PUA characters (next section), because this interferes with Wikipedia's flexibility, and it is impossible to foresee what fonts will be installed on a user's computer.

Guarapiranga  04:10, 15 June 2022 (UTC)Reply

I don't think that's the same thing. Font family definition appears to be used in the past to render characters in a certain font because older browsers could not automatically select an appropriate font. I like having a font change as it catches the reader's eye, especially when it's in a paragraph with a lot of other text. That said, I suppose it wouldn't be too difficult to add a parameter to suppress the font change. —Tenryuu 🐲 ( 💬 • 📝 ) 04:56, 15 June 2022 (UTC)Reply
Or, alternatively, add a parameter, e.g. |style=, to change the font (if that's at all necessary and compliant, when editors can simply enclose the template in {{font}}). Here are other help pages that use it: Guarapiranga  06:49, 15 June 2022 (UTC)Reply

Rename to Template:Preferences?

edit

Should template Template:Myprefs be renamed to Template:Preferences? "Myprefs" made sense with the original wording, which was replaced in Special:Diff/525028556 after Wikipedia:Village pump (technical)/Archive 105#Small change to the top right menu. —⁠andrybak (talk) 15:09, 11 September 2024 (UTC)Reply