Hello. In my attempt to use mediawiki for my faculty's intranet, a new obstacle just caught my attention. I guess this would happen with most languages, not only spanish.
Question in this message: *) Is there a way to make somthing like the Wrongtitle template, that instead of showing the "technical restrictions" message, would just render the right page title? I'm not afraid of digging into the code if necesary, I just need pointers on where to begin.
Rationale:
Most of my page titles have accents, tildes or other non-ascii characters. For instance, a link to the page about Logics ([[Lógica]]) would be http://mywiki/wiki/L%C3%B3gica, wich in turns would get rendered by the browser as http://mywiki/wiki/L%C3%B3gica. Not only that url is near-to-impossible for our users to learn, but also to type if they know that "%C3%B3" is "ó" but don't have an spanish keyboard available (very common, as most people in my faculty find the english layout a lot easier for programming). So I proposed the idea of using either [[Logica|Lógica]] or rewriting the [[]] parser code, so that the [[Lógica]] link would get rendered as "Lógica" in the text, but link to "/wiki/Logica".
So far, no problems... except that when the user visits the now /wiki/Logica link, the text reads "Logica" as the page title (I know it is parsed directly from the URL, so it wasn't unexpected). Is there any way to make the page display the right title instead of the one parsed from the url? (something like the {{Template:Wrongtitle}}, but instead of rendering a "technical restrictions warning", just fixing the title). I'm not afraid of digging into the code, but I just don't know where to start.
On a related note, I would like to be able to correct some misstypings on the url, i.e, if the url does not exist and there is another very similar (levenshtein distance), return a redirection page pointing to the right article. This seems more complex, so I won't dig into it just yet, but if you know of an extension that would let me do this, please tell me.
On 1/27/07, Luis Zarrabeitia kyrie@uh.cu wrote:
Hello. In my attempt to use mediawiki for my faculty's intranet, a new obstacle just caught my attention. I guess this would happen with most languages, not only spanish.
Question in this message: *) Is there a way to make somthing like the Wrongtitle template, that instead of showing the "technical restrictions" message, would just render the right page title? I'm not afraid of digging into the code if necesary, I just need pointers on where to begin.
You're asking how to solve this problem in a specific way that would be hard, instead of just asking how to solve the overall problem, which happens to have an easy solution :-)
Make redirect pages. `Logica' without the accent points to `L'ogica' with the accent (I have an English keyboard too :-) etc. When people type in Logica in the URL, they get the accented page; they can use [[Logica]] or [[Logica|L'ogica]] or [[L'ogica]] for accents ('o representing the acute accented o), though the first will give in-page text "Logica" instead of "L'ogica"; it will Just Work, hopefully.
I'm pretty sure this is done by at least some of the foreign language Wikipedias.
If you have many such pages, you may be able to automate the creation of redirects; hook page creation and renaming, perhaps.
Hope this helps.
-- Josh
It helps. I'm already doing that. That's why I asked the second quiestion at the bottom of the message (more than a question, it was a random thought), to make it more... automatic. There is also an inconvenience with subpages, I think.
After I sent the message, I saw there was a (template?) named "DISPLAYTITLE", that was suposed to do exactly what I asked, but that is marked as "doesn't work at all" (with two open bugs on the bugzilla). I think I'll use either the redirects or the part of DISPLAYTITLE that works (on my installation, it only fails to write the <title> on the html head, the rest seems to fairly work well), and try to fix that couple of bugs...
Thanks.
K.
Quoting Joshua Oreman oremanj@gmail.com:
On 1/27/07, Luis Zarrabeitia kyrie@uh.cu wrote:
Hello. In my attempt to use mediawiki for my faculty's intranet, a new obstacle
just
caught my attention. I guess this would happen with most languages, not
only
spanish.
Question in this message: *) Is there a way to make somthing like the Wrongtitle template, that
instead of
showing the "technical restrictions" message, would just render the right
page
title? I'm not afraid of digging into the code if necesary, I just need
pointers
on where to begin.
You're asking how to solve this problem in a specific way that would be hard, instead of just asking how to solve the overall problem, which happens to have an easy solution :-)
Make redirect pages. `Logica' without the accent points to `L'ogica' with the accent (I have an English keyboard too :-) etc. When people type in Logica in the URL, they get the accented page; they can use [[Logica]] or [[Logica|L'ogica]] or [[L'ogica]] for accents ('o representing the acute accented o), though the first will give in-page text "Logica" instead of "L'ogica"; it will Just Work, hopefully.
I'm pretty sure this is done by at least some of the foreign language Wikipedias.
If you have many such pages, you may be able to automate the creation of redirects; hook page creation and renaming, perhaps.
Hope this helps.
-- Josh
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 27/01/07, Luis Zarrabeitia kyrie@uh.cu wrote:
*) Is there a way to make somthing like the Wrongtitle template, that instead of showing the "technical restrictions" message, would just render the right page title? I'm not afraid of digging into the code if necesary, I just need pointers on where to begin.
There are several templates on English Wikipedia that do this job nicely for browsers with Javascript, and default to {{wrongtitle}}-like behaviour when the browser doesn't have Javascript. Of course, like all the really clever templates on en:wp, it goes several layers of incomprehensible inclusions deep ... See http://en.wikipedia.org/wiki/Template:Wrong_title_templates .
- d.
mediawiki-l@lists.wikimedia.org