Wikia

Community Central

Why switch doesn't work with PAGENAME

97,148pages on
this wiki

Forum page

This Forum has been archived

Visit the new Forums
Forums: Index Support Requests Why switch doesn't work with PAGENAME
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 861 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


The templates below import following template:

It seems that if you fill parameter with string that contains: ', manually it will work, but if you do it with PAGENAME it won't. In the same time if string doesn't contains ', it will work normally in both cases. Look at the source codes for better understanding.  AW10  Talk  Contribs  E-Mail  23:05,8/8/2012 


Whoa. That's pretty bizarre. I've fiddled with those templates and I can't see anything overtly wrong; hell, even this doesn't seem to work:

{{#ifeq:{{PAGENAME}}|Im'provisation|Equal|Not Equal}}

I did find a workaround though, THIS works:

{{#ifeq:{{PAGENAMEE}}|Im%27provisation|Equal|Not Equal}}

...

Okay, I just searched Google and found these:

It's a parser bug in MediaWiki. You can fix it like this:

{{#ifeq:{{PAGENAME}}|Im'provisation|Equal|Not Equal}}
{{#switch:{{PAGENAME}}|Im'provisation|Im'provisation|Im'provisation|Im'provisation|Im'provisation=Text 1|Improvisation=Text 2}}

(' is a HTML Entity, 39 is the Unicode/ANSI/ASCII code for an apostrophe). Be aware that handling apostrophes is glitchy as heck because of the bug I linked to above, there are about 5 (if not more that I can't think of right now) different ways of encoding an apostrophe so it is very easy to break a naive template. Lunarity 04:12, August 9, 2012 (UTC)


Thanks!  AW10  Talk  Contribs  E-Mail  10:02,8/9/2012 

Around Wikia's network

Random Wiki