Forum:PHP translation to MediaWiki

Ok, so on SporeWiki, on the following pages:
 * w:c:spore:Vehicle:Kralgon Crusher
 * w:c:spore:Creature:Kralgon/Military/AI Weapons

I used a bit of .js coding. On the former:  And on Creature:Kralgon/Military/AI Weapons I used: 

This is meant to be, so that when you view Vehicle:Kralgon Crusher from Creature:Kralgon/Military/AI Weapons, the navboxes will not show. However, when you view it from Vehicle:Kralgon Crusher, they do show.

The problem is visible from that page. Could someone possibly translate those codes into something that works with MediaWiki?--Technobliterator 08:26, August 31, 2011 (UTC)


 * As you know by now, php will never work.
 * You need to use include, noinclude and/or includeonly to control that sort of thing.
 * In the included template (in this case Vehicle:Kralgon Crusher) you need to put noinclude around the parts that you don't want to appear in other pages.
 * If you want finer tune then you have to use something else; I think an ifeq with would work.
 * Yeah, the former doesn't work; Creature:Kralgon/Military/AI Weapons views Vehicle:Kralgon Crusher via tabview, which doesn't transclude pages, so noinclude doesn't work. However, I'm as for the #ifeq: parser function, I'm not so sure about it, as I've never used it before. Can you tell me any codes which would work?--Technobliterator 14:17, August 31, 2011 (UTC)
 * Oh also, where would #ifeq: go, what page?--Technobliterator 16:08, August 31, 2011 (UTC)
 * Anyone there?--Technobliterator 19:37, August 31, 2011 (UTC)


 * See mw:Help:Extension:ParserFunctions --Ciencia Al Poder (talk) -WikiDex 19:40, August 31, 2011 (UTC)

Put in Vehicle:Kralgon Crusher

Replace put_here_the_navbox_stuff with what you want to appear only in that specific page. 20:42, August 31, 2011 (UTC)

Ok, so that doesn't work in, as it doesn't transclude Vehicle:Kralgon Crusher, literally loads the contents of it as if viewing the contents on the page. So yeah, it's down to codes. Javascript?--Technobliterator 23:16, August 31, 2011 (UTC)

I think I'm stuck with using javascript, or something that does the same as the php code. Any ideas?--Technobliterator 10:53, September 1, 2011 (UTC)


 * Ah, if tabview really works that way it explains why the show/hide code doesn't work in that page.
 * 12:33, September 1, 2011 (UTC)


 * Yeah, the only problem is how to prevent it from loading the contents of the navbox when viewed in tabview, yet still show the navbox when viewed normlly. As for switching to it makes pages incredibly slow to load.--Technobliterator 14:09, September 1, 2011 (UTC)


 * Then separate the page Vehicle:Kralgon Crusher into 2 pages, on the second page you put the stuff that you want to be in the tabview and on the current Vehicle:Kralgon Crusher page you put the other stuff plus a template call to that second page.
 * On Creature:Kralgon/Military/AI Weapons you call that second page.
 * 14:51, September 1, 2011 (UTC)
 * I see. Is that really the only way to do it? Because if that's the case, I may as well just remove the navbox on Vehicle:Kralgon Crusher.--Technobliterator 16:03, September 1, 2011 (UTC)