Hi there,
I was asked to setup a MediaWiki but there are some strange (though obvious in their case) requests that have been made which I'm not sure what the best solution for integration is. Here they are briefly:
- They have a list of authors and animators and would like to sort them in a category by last name first. All the articles currently created begin with first and last. I realised that there is a transclusion option called {{DEFAULTSORT:}} which lets you define its sort value. The problem is, I'm not sure how to invert and display the name on the category page with the inverse. http://meta.wikimedia.org/wiki/Help:Category doesn't tell me much other than about the default sort value. - The Wiki is going to be based on a massive bibliographical system. I've searched high and low for good biblio extensions, but they pretty much do not do what we want. What I've decided to do is have the bibliography entries listed on each Article under a Bibliography header. I am writing an extension which finds all pages with a similar header and parses all the bibliographical entries, which are listed in MLA format. I'm wondering if there is a much better way of doing this, because then I have to consolidate duplicate entries by using a lot of regex (ack).
That's about it for now, there are other minor things, but before I bother the mailing list I'm going to do my research and figure them out with the help files. For now these are the only things I can't seem to solve on my own.
Regards,
David
David Di Biase schreef:
Hi there,
I was asked to setup a MediaWiki but there are some strange (though obvious in their case) requests that have been made which I'm not sure what the best solution for integration is. Here they are briefly:
- They have a list of authors and animators and would like to sort them
in a category by last name first. All the articles currently created begin with first and last. I realised that there is a transclusion option called {{DEFAULTSORT:}} which lets you define its sort value. The problem is, I'm not sure how to invert and display the name on the category page with the inverse. http://meta.wikimedia.org/wiki/Help:Category doesn't tell me much other than about the default sort value.
Just use {{DEFAULTSORT:Einstein, Albert}} on the page about Albert Einstein. There's no way of doing this automatically, partly because the software wouldn't know what to do with names like Hillary Rodham Clinton (is Rodham a middle name or a surname?).
Roan Kattouw (Catrope)
Huh? lol...
I might not have been too articulate in my question. I got it to work with the organisation, I'm just wondering how do I get it to display as "Einstein, Albert" on the category name?
Dave
On Wed, Mar 25, 2009 at 8:13 PM, Roan Kattouw roan.kattouw@home.nl wrote:
David Di Biase schreef:
Hi there,
I was asked to setup a MediaWiki but there are some strange (though
obvious
in their case) requests that have been made which I'm not sure what the
best
solution for integration is. Here they are briefly:
- They have a list of authors and animators and would like to sort
them
in a category by last name first. All the articles currently created
begin
with first and last. I realised that there is a transclusion option
called
{{DEFAULTSORT:}} which lets you define its sort value. The problem is,
I'm
not sure how to invert and display the name on the category page with
the
inverse. http://meta.wikimedia.org/wiki/Help:Category doesn't tell me much other than about the default sort value.
Just use {{DEFAULTSORT:Einstein, Albert}} on the page about Albert Einstein. There's no way of doing this automatically, partly because the software wouldn't know what to do with names like Hillary Rodham Clinton (is Rodham a middle name or a surname?).
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Mar 25, 2009 at 8:43 PM, David Di Biase dave.dibiase@gmail.com wrote:
I might not have been too articulate in my question. I got it to work with the organisation, I'm just wondering how do I get it to display as "Einstein, Albert" on the category name?
This is not currently supported.
On Wed, Mar 25, 2009 at 8:43 PM, David Di Biase dave.dibiase@gmail.com wrote:
I might not have been too articulate in my question. I got it to work with the organisation, I'm just wondering how do I get it to display as "Einstein, Albert" on the category name?
Hi Dave,
How do you feel about writing PHP? You could do this with an extension to CategoryPage. We had to write one recently because our users wanted other information displayed next to article names (like flag of country of origin based on what other categories a page was in). Hook in at this one: http://www.mediawiki.org/wiki/Manual:Hooks/CategoryPageView
Of course if someone were to decide to change the way core does category pages to allow us to hook in for changing the way links are displayed on the category page I would be THRILLED. But it isn't important enough to me for me to volunteer to do it myself.
Good luck Dave! -Courtney
Christensen, Courtney wrote:
On Wed, Mar 25, 2009 at 8:43 PM, David Di Biase dave.dibiase@gmail.com wrote:
I might not have been too articulate in my question. I got it to work with the organisation, I'm just wondering how do I get it to display as "Einstein, Albert" on the category name?
How do you feel about writing PHP? You could do this with an extension to CategoryPage.
Not sure about doing it with an extension, but it should be trivial to kluge. Actually, here's a patch that ought to do it:
--- includes/CategoryPage.php (revision 48416) +++ includes/CategoryPage.php (working copy) @@ -189,7 +189,7 @@ */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; - $titletext = $wgContLang->convert( $title->getPrefixedText() ); + $titletext = $wgContLang->convert( $sortkey ); $this->articles[] = $isRedirect ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>' : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
It would be easy to make this depend on a config option, too. If anyone else thinks that would be a good idea, I can commit it.
On Thu, Mar 26, 2009 at 3:24 PM, Ilmari Karonen nospam@vyznev.net wrote:
--- includes/CategoryPage.php (revision 48416) +++ includes/CategoryPage.php (working copy) @@ -189,7 +189,7 @@ */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang;
- $titletext = $wgContLang->convert( $title->getPrefixedText() );
- $titletext = $wgContLang->convert( $sortkey );
$this->articles[] = $isRedirect ? '<span class="redirect-in-category">' . $this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>' : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
It would be easy to make this depend on a config option, too. If anyone else thinks that would be a good idea, I can commit it.
Doesn't this introduce a trivial XSS vulnerability?
Aryeh Gregor wrote:
On Thu, Mar 26, 2009 at 3:24 PM, Ilmari Karonen nospam@vyznev.net wrote:
--- includes/CategoryPage.php (revision 48416) +++ includes/CategoryPage.php (working copy) @@ -189,7 +189,7 @@ */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang;
$titletext = $wgContLang->convert( $title->getPrefixedText() );
$titletext = $wgContLang->convert( $sortkey ); $this->articles[] = $isRedirect ? '<span class="redirect-in-category">' .
$this->getSkin()->makeKnownLinkObj( $title, $titletext ) . '</span>' : $this->getSkin()->makeSizeLinkObj( $pageLength, $title, $titletext );
It would be easy to make this depend on a config option, too. If anyone else thinks that would be a good idea, I can commit it.
Doesn't this introduce a trivial XSS vulnerability?
Hmm, you're right, it does -- I didn't realize the title was used unescaped. That looks uncomfortably close to an XSS vulnerability anyway. I'd feel a lot more comfortable with a htmlspecialchars() in there. (Didn't we use to allow "<" in titles not so very long ago? Certainly the feature that disallows HTML entities in titles is fairly recent.)
On Thu, Mar 26, 2009 at 9:15 PM, Ilmari Karonen nospam@vyznev.net wrote:
Hmm, you're right, it does -- I didn't realize the title was used unescaped. That looks uncomfortably close to an XSS vulnerability anyway. I'd feel a lot more comfortable with a htmlspecialchars() in there. (Didn't we use to allow "<" in titles not so very long ago? Certainly the feature that disallows HTML entities in titles is fairly recent.)
I'm pretty sure we haven't allowed < in titles for a long time.
At one point they were briefly enabled in dev trunk and immediately disabled for safety. :) never been enabled in production.
-- brion vibber (brion @ wikimedia.org)
On Mar 26, 2009, at 18:30, Aryeh Gregor <Simetrical +wikilist@gmail.com> wrote:
On Thu, Mar 26, 2009 at 9:15 PM, Ilmari Karonen nospam@vyznev.net wrote:
Hmm, you're right, it does -- I didn't realize the title was used unescaped. That looks uncomfortably close to an XSS vulnerability anyway. I'd feel a lot more comfortable with a htmlspecialchars() in there. (Didn't we use to allow "<" in titles not so very long ago? Certainly the feature that disallows HTML entities in titles is fairly recent.)
I'm pretty sure we haven't allowed < in titles for a long time.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Brion Vibber wrote:
On Mar 26, 2009, at 18:30, Aryeh Gregor <Simetrical +wikilist@gmail.com> wrote:
On Thu, Mar 26, 2009 at 9:15 PM, Ilmari Karonen nospam@vyznev.net wrote:
Hmm, you're right, it does -- I didn't realize the title was used unescaped. That looks uncomfortably close to an XSS vulnerability anyway. I'd feel a lot more comfortable with a htmlspecialchars() in there. (Didn't we use to allow "<" in titles not so very long ago? Certainly the feature that disallows HTML entities in titles is fairly recent.)
I'm pretty sure we haven't allowed < in titles for a long time.
At one point they were briefly enabled in dev trunk and immediately disabled for safety. :) never been enabled in production.
Anyway, I just committed r48922. Whatever else re-enabling "<" in titles might break, category listings should now be safe. :)
wikitech-l@lists.wikimedia.org