Last modified: 2014-05-01 11:21:14 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.
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.
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 */
(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 */
(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
(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:", ""); }) */
Could {{DEFAULTSORT}} be modified to do this?
(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.
(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.
(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).