Topic on Project:Support desk

How to add wikitext into a skin

5
Stefahn (talkcontribs)

How can I add wikitext into my skin file?
I tried the following but it didn't work:

global $wgOut;
$wgOut->parse( $wikitext );
88.130.101.135 (talkcontribs)

You possibly can. Where in PHP do you want to add the wikitext? Are you using a skin-related hook? Or are you inside a skin file like Vector.php (or in the according file of your own skin maybe)?

Stefahn (talkcontribs)

I'm inside Vector.php. Thanks.

88.130.101.135 (talkcontribs)

In the template file you can put HTML. If you want to put wikitext there, then you would have to have this wikitext rendered afterwards; meaning you would basically have to render two parts of your skin: The text from the according wiki page and your wikitext from the skin file. That is not good.

If it only is one certain text, you could register it as a language label - that would then also make the text translatable.

If the text should always appear at one fixed place inside/directly above or directly below the actual page content, then I would try with one of the skin hooks - in some of them you can use wikitext.

Stefahn (talkcontribs)

Thanks for your helpful advice!

I could solve it by adding the plain HTML code. It was the SMW info box - I thought I had tested this before and it didn't work by adding the HTML code, but now it did.

Reply to "How to add wikitext into a skin"