Topic on Talk:MediaWiki 1.18

87.21.241.8 (talkcontribs)

with new mediawiki on skin.php files (modern.php for example) there aren't head section, i need to add my javascript to it how i should do this?

Dantman (talkcontribs)

We stopped using manually written heads and <body>s back in 1.16 and replaced them with the headelement.

To add styles define a `function setupSkinUserCss( OutputPage $out )` in the class you extend from SkinTemplate and make calls to $out there to (preferably) load a resource loader module with your styles. Or make addStyle calls. Likewise to add scripts do similar inside of a `function initPage( OutputPage $out )`.

If you're not writing your own skins, you should do things the normal way using the BeforePageDisplay hook and calls to output, or for analytics type scripts using SkinAfterBottomScripts.

209.6.31.161 (talkcontribs)

Hi,

Google AdSense or DFP js-scripts need to be loaded on the head section of the page. How can I achieve this?

Reply to "where is defined head"