Last modified: 2014-09-18 13:13:06 UTC
Special:Preferences should support a URL parameter that makes it open to a specified user preference, rather than just starting on the "General" tab. For example: http://example.com/wiki/Special:Preferences?pref=showtoc would cause Special:Preferences to open with its Appearance tab active, since that is where the "showtoc" (Show table of contents) checkbox lives. This would be a great help with documentation. Instead of wiki pages saying, "Click My Preferences, then click the Appearance tab," they can provide a direct link to the setting in question. This feature opens the doors to useful doc templates like this one: Change the setting "{{MediaWiki:tog-{{{1}}}}}" by clicking [{{fullurl:Special:Preferences|pref={{{1}}}}} HERE]. This request is related to bug 27559, which asks for Special:Preferences to open a specified tab. My suggestion abstracts away the tab and focuses on the preference setting itself... after all, the Preferences UI could change someday (say, changing tabs into something else), but the preference names are not likely to change.
Finding an element and then finding out which tab it's in *should* be pretty straightforward; I'm adding bug 27559 as a dependency here since this should be just an extension of the code needed there.
See also wm_reveal_for_hash() of MobileFrontend, which does something similar. http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/MobileFrontend/javascripts/application.js?revision=101737&view=markup
Dan: Isn't this kind of fixed by being able to link to the first section in a tab, e.g. for "Appearance" https://www.mediawiki.org/wiki/Special:Preferences#mw-prefsection-rendering ? I'd close this as RESOLVED WORKSFORME as it seems to be good enough.
This is now possible by linking to Special:Preferences#tabname.
Reopening: linking to a tab and linking to a preference are not the same thing. Some preference tabs are a jumble of dozens of esoteric options, forcing the user to figure out which one they have to change is not helpful at all. There should be a way to link to a specific preference, and that should create some sort of visual highlighting to that preference. The simplest implementation would be using Special:Preferences#<input element id>, then a script would locate the input element, open the parent tab, scroll the element into view, and add a yellow background to its container element ( $(element).closest('[id^=mw-htmlform-field-]') at first glance).