From: Markus K. <ma...@se...> - 2008-06-05 07:51:28
|
On Dienstag, 3. Juni 2008, Temlakos wrote: > Anyone: > > How do I check the value of {{PAGENAME}} against a test string > containing the English single-quote character commonly used as an > apostrophe? It seems to me that this problem is related to #switch (or to MW in general) rather than to SMW, so maybe the MW developers on the wikitech-l can help. SMW does replace ' by ' in values of Type:Page, since a link [[''Test'']] fails in MediaWiki (even though you can create an article of that name!). Maybe something like that escape could help you as well. -- Markus > > I have a page name containing an apostrophe in a French-language wiki. I > want to apply a template that checks the page name against a small set > of names and apply semantic annotation if the page name is a member of > the set, and use an unannotated internal link if it does not. Here is > the important part of the code: > > [[{{#switch: {{PAGENAME}}|Zone de Kuiper|Disque d'éparpillage|Nuage > d'Oort|Némésis=Membre de::Objets trans-neptuniens|Objets > trans-neptuniens}}|Objets trans-neptuniens]] > > If the page name is "Zone de Kuiper" it will work. But it will not work > with "Nuage d'Oort". Why not? > > Any suggestions would be appreciated. > > Temlakos > > PS: Whether the page "Objets trans-neptuniens" currently exists or not > should be irrelevant. The equivalent code in English is: > > [[{{#switch: {{PAGENAME}}|Kuiper belt|Scatter disk|Oort > cloud|Nemesis=Member of::Trans-Neptunian Objects|Trans-Neptunian > Objects}}|Trans-Neptunian Objects]] > > and /that/ code works for the article titled "Oort cloud," even though > "Trans-Neptunian objects" does not yet exist. > > Temlakos > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Semediawiki-user mailing list > Sem...@li... > https://lists.sourceforge.net/lists/listinfo/semediawiki-user -- Markus Krötzsch Semantic MediaWiki http://semantic-mediawiki.org http://korrekt.org ma...@se... |