Last modified: 2011-03-04 10:19:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25315, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23315 - naming of body class "page-Foo_Bar" should ignore pseudo-sub-pages in ns -1
naming of body class "page-Foo_Bar" should ignore pseudo-sub-pages in ns -1
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-25 03:44 UTC by Thana
Modified: 2011-03-04 10:19 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Thana 2010-04-25 03:44:42 UTC
Here's one example; let's say i want to set all links
pink if i'm on Special:Contributions. Not so easy:

.page-Special_Contributions a { color:pink; }

But if I go to [[Special:Contributions/Some_user]] and
look closely i see that it produces a unique className
like ".page-Special_Contributions_Some_user" for each
"sub-page", despite them not being sub-pages but rather
a short-hand for the "target" parameter cf.
/index.php?title=Special:Contributions&target=Some_user
is a completely identical page except for the user-name
not being part of its body-class.

target-specific skinning of special pages *may* have a
few weird and niche uses, but i doubt it's what most
people would expect or ever want.

Looks like the cleanest way is to fulfill the example
exercise is to inject css via js? Poor.

> if(wgPageName=="Special:Contributions")
>          appendCSS("a { color:pink; }");

Well i did notice that wgPageName never includes the
user-name or anything else after the slash in the url
of a "Special:" page.

Surely this and the body-class ought, at a minimum, to
be mutually consistent...?
Comment 1 Ilmari Karonen 2011-02-02 13:04:42 UTC
I agree that this is a bug, especially given the inconsistency between Special:Contributions/User and Special:Contributions?target=User.

On the other hand, I _can_ think of some few legitimate uses for having special page subpages in the class name, like [[Special:Watchlist/edit]], [[Special:UserLogin/signup]] or even [[Special:Contributions/newbies]].  I suppose we could always provide two class names, one with and one without subpages.

Alternatively, we could leave the page-Foo classes as they are, and add an extra class for special pages (maybe "special-Contributions").  This would also be a good opportunity to use the canonical instead of the localized name.
Comment 2 Ilmari Karonen 2011-02-06 21:11:01 UTC
Fixed in r81604: special pages now have an extra "special-Whatever" body class based on the canonical special page name without subpages.
Comment 3 Thana 2011-03-04 10:19:21 UTC
> On the other hand, I _can_ think of some few legitimate uses for having
> special page subpages in the class name, like [[Special:Watchlist/edit]],
> [[Special:UserLogin/signup]] or even [[Special:Contributions/newbies]].  I
> suppose we could always provide two class names, one with and one without
> subpages.

would that apply to pages in namespaces where "real" sub-pages are allowed,
i.e. would [[Wikipedia:Arbitration/Requests/Enforcement/Archive71]] get the
following body-class names:
> page-Wikipedia_Arbitration
> page-Wikipedia_Arbitration_Requests
> page-Wikipedia_Arbitration_Requests_Enforcement
> page-Wikipedia_Arbitration_Requests_Enforcement_Archive71

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links