Last modified: 2014-05-01 11:21:14 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 T31975, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29975 - Provide a way to alter page titles in category listings, e.g. via display title
Provide a way to alter page titles in category listings, e.g. via display title
Status: NEW
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
unspecified
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 17212
Blocks: 491 29928
  Show dependency treegraph
 
Reported: 2011-07-20 06:40 UTC by Niklas Laxström
Modified: 2014-05-01 11:21 UTC (History)
6 users (show)

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


Attachments

Description Niklas Laxström 2011-07-20 06:40:41 UTC
There should be a way to not use the actual page titles but something else instead in the category listing. Would be useful for example translated titles.
Comment 1 Technical 13 2012-04-12 01:18:00 UTC
Would be very useful to me at the moment.  I'm having a discussion about a custom namespace on a wiki I administrate, and the major concern seems to that the pages in the namespace show up as NS:foo instead of just foo on the category pages.
Comment 2 Technical 13 2012-04-20 02:48:38 UTC
I cogitated a workaround that seems to work for me in css..
There has to be a better way though....


/* strip "NS:" namespace from category pages fix */
a[title^='NS:'] {
    font-family: 'Lucida Grande', Geneva, Arial, Verdana, monospace; /*your font(s) +", monspace"*/
    font-size: 12px; /*Set to whatever font-size those items currently use*/
    display: inline-block;
    overflow: hidden;
    text-indent: -1.5em; /*fudge this number until your namespace prefix disappears*/
}
/* strip "NS:" namespace from category pages fix end */
Comment 3 Technical 13 2012-04-20 02:50:29 UTC
(In reply to comment #2)
> I cogitated a workaround that seems to work for me in css..
> There has to be a better way though....
> 
> 
> /* strip "NS:" namespace from category pages fix */

div#mw-pages /*declare the category listing section*/

> a[title^='NS:'] {
>     font-family: 'Lucida Grande', Geneva, Arial, Verdana, monospace; /*your
> font(s) +", monspace"*/
>     font-size: 12px; /*Set to whatever font-size those items currently use*/
>     display: inline-block;
>     overflow: hidden;
>     text-indent: -1.5em; /*fudge this number until your namespace prefix
> disappears*/
> }
> /* strip "NS:" namespace from category pages fix end */
Comment 4 Bawolff (Brian Wolff) 2012-04-21 17:47:12 UTC
(In reply to comment #2)
> I cogitated a workaround that seems to work for me in css..
> There has to be a better way though....
> 
> 
> /* strip "NS:" namespace from category pages fix */
> a[title^='NS:'] {
>     font-family: 'Lucida Grande', Geneva, Arial, Verdana, monospace; /*your
> font(s) +", monspace"*/
>     font-size: 12px; /*Set to whatever font-size those items currently use*/
>     display: inline-block;
>     overflow: hidden;
>     text-indent: -1.5em; /*fudge this number until your namespace prefix
> disappears*/
> }
> /* strip "NS:" namespace from category pages fix end */

That's disgusting :P
Comment 5 Technical 13 2012-04-21 18:18:10 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > I cogitated a workaround that seems to work for me in css..
> > There has to be a better way though....
> > 
> > 
> > /* strip "NS:" namespace from category pages fix */
> > a[title^='NS:'] {
> >     font-family: 'Lucida Grande', Geneva, Arial, Verdana, monospace; /*your
> > font(s) +", monspace"*/
> >     font-size: 12px; /*Set to whatever font-size those items currently use*/
> >     display: inline-block;
> >     overflow: hidden;
> >     text-indent: -1.5em; /*fudge this number until your namespace prefix
> > disappears*/
> > }
> > /* strip "NS:" namespace from category pages fix end */
> 
> That's disgusting :P

Yes, but it visually worked.. For those that can use JavaScript, there is an alternative:

/*
Namespace Stripping
Fix by DDOwiki User:Ague
20 April 2012
*/
$('a[title^="Item:"]').each(function() {
    this.innerHTML = this.innerHTML.replace("Item:", "");
    this.title = this.title.replace("Item:", "");
})
/* Leave final semi-colon out. When MW parses this, for some reason it automatically adds a semi-colon. */

/* Optionally, un-comment the code below to strip the Item: from the page title as well.  

MAKE SURE TO ADD THE SEMI-COLON AFTER THE }) ABOVE IF YOU UN-COMMENT BELOW!  */

/*
$('h1#title').each(function() {
    this.innerHTML = this.innerHTML.replace("Item:", "");
});
$('title').each(function() {
    this.innerHTML = this.innerHTML.replace("Item:", "");
})
*/
Comment 6 Technical 13 2013-06-13 12:48:44 UTC
Could {{DEFAULTSORT}} be modified to do this?
Comment 7 Nemo 2013-06-13 12:55:40 UTC
(In reply to comment #6)
> Could {{DEFAULTSORT}} be modified to do this?

This bug is about giving this possibility in core, not about providing an interface for it. For instance, it would be used by bug 29928.
Comment 8 Bawolff (Brian Wolff) 2013-06-13 15:11:17 UTC
(In reply to comment #6)
> Could {{DEFAULTSORT}} be modified to do this?

I think it would be possible to write an extension that would use defaultsort to do that, but it would be hacky beyond hacky so I wouldn't reccomend it.
Comment 9 Nemo 2014-05-01 11:21:14 UTC
(In reply to Bawolff (Brian Wolff) from comment #8)
> I think it would be possible to write an extension that would use
> defaultsort to do that, but it would be hacky beyond hacky so I wouldn't
> reccomend it.

Display title / DISPLAYTITLE (which by default is restricted to case changes) is probably the most sensible property to reuse so I'm marking it as blocker, but this bug may be solved in other ways as well, as long as it allows Translate to set/use it (bug 29928).

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


Navigation
Links