Template talk:Myprefs
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)
- 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)
- 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)
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)- OK. Where did I go wrong here? --Redrose64 🌹 (talk) 12:04, 13 July 2024 (UTC)
#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)- 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)
- 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)
- Created Template:Myprefs/section. Used only in sandbox for now. —andrybak (talk) 08:12, 16 July 2024 (UTC)
- Implemented in Special:Diff/1235305838. —andrybak (talk) 21:24, 18 July 2024 (UTC)
- Created Template:Myprefs/section. Used only in sandbox for now. —andrybak (talk) 08:12, 16 July 2024 (UTC)
- 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)
- 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 anid
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)
- @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)
- OK. Where did I go wrong here? --Redrose64 🌹 (talk) 12:04, 13 July 2024 (UTC)
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)
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)
- 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}} (e • t • c)
18:58, 24 January 2015 (UTC) - 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}} (e • t • c)
19:03, 24 January 2015 (UTC)- 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)|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}} (e • t • c)
19:44, 24 January 2015 (UTC)
- Made the above change and updated docs. —
{{U|Technical 13}} (e • t • c)
19:50, 24 January 2015 (UTC)- 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)- 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}} (e • t • c)
22:39, 24 January 2015 (UTC)
- Oh, you want a tooltip! Just use the image caption.
-- [[User:Edokter]] {{talk}}
22:47, 24 January 2015 (UTC)- apparently now works, it didn't use to. Maybe I couldn't find the ticket because it was already fixed. —
{{U|Technical 13}} (e • t • c)
22:49, 24 January 2015 (UTC)- 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)
- I think that was fixed over a year ago. Closest I could find is phab:T45836.
- apparently now works, it didn't use to. Maybe I couldn't find the ticket because it was already fixed. —
- Alt doesn't work. (nothing on mouseover with
- Alt and title serve two completely different purposes. Why are you utilizing
- Now it's a bit clear, in which case the
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)
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
- 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: Thank you. Rummskartoffel 22:36, 14 December 2021 (UTC)
|- | Banners || {{myprefs|Banners}}
Avoid line breaks between checkbox and text
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
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)
- 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
doesn't work after an image.) Nardog (talk) 02:49, 23 December 2021 (UTC)- Are there any parameter texts that are long enough that this would be a problem? --Yair rand (talk) 17:50, 23 December 2021 (UTC)
- 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)
- Are there any parameter texts that are long enough that this would be a problem? --Yair rand (talk) 17:50, 23 December 2021 (UTC)
- Done with {{nowrap}} and {{wrap}}. Nardog (talk) 06:08, 26 December 2021 (UTC)
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)
- 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)- 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:- Help:CharInsert
- Help:Cite errors
- Help:Edit toolbar
- Help:Email notification
- Help:Link
- Help:Preferences
- Help:Searching
- Help:Section
- Help:Text editor support
- Or, alternatively, add a parameter, e.g.
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)