Last modified: 2011-08-14 18:26:39 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 T16549, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14549 - Add custom classes to interwiki links per project within a wiki family
Add custom classes to interwiki links per project within a wiki family
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 22771
  Show dependency treegraph
 
Reported: 2008-06-15 18:01 UTC by italvet
Modified: 2011-08-14 18:26 UTC (History)
4 users (show)

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


Attachments

Description italvet 2008-06-15 18:01:36 UTC
Hello. On fr.wikibooks we would like to differentiate the external links depending of the project they refeer to. Currently all the wikimedia internal links use the "exitw" class, so the only way to detect if they lead to wikipedia, wikisource... is to use a javascript for parse the href attribute.

it should be useful if wikipedia links have a "link-wikipedia" class, wikisource a "link-wikisource" class, etc.
Comment 1 Daniel Friesen 2008-06-15 18:41:22 UTC
Actually it can be done with CSS3, supported by a number of the latest browsers.

a.exitw[href*=wikimedia.org]

or whatever ^= or *= you need to match the href. It doesn't need JS, CSS will work fine. It's already used for all the special icons like the mailto e-mail icon.
Comment 2 italvet 2008-06-15 18:48:33 UTC
but could it be implemented in the software anyway ? *= don't looks enough reliable to me. for example if the link is [[s:all about wikimedia.org]] the result could be quite unpredictable.
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-06-15 18:54:36 UTC
a.exitw[href^=http://meta.wikimedia.org/] or similar would work, except that the language code comes before the second-level domain name, so you'd have to list all languages individually.  Thanks for being backwards, DNS.  :(

Not sure this deserves yet another collection of classes.
Comment 4 italvet 2008-06-15 19:09:21 UTC
and it's not about hardwriting a "collection of classes" but more about generating classes dynamicly from the "sitematrix".
Comment 5 Platonides 2010-03-14 23:17:23 UTC
You can use a.exitw[href*=".wikipedia.org/wiki/"] selector. That's not perfect, but since having a couple of classes per project ([[s:Foo]] and [[wikisource:Foo]]) isn't much better, I think you better stick with it.

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


Navigation
Links