Topic on Manual talk:How to make a MediaWiki skin

Best way to reference images in skins, outside of stylesheets?

4
Samwilson (talkcontribs)

Is there a preferred way to create <img /> elements in PHP in skins? What's the best way to get the URL path to a skin's resources/images/foo.png file, for instance?

It looks like some skins use the $wgStylePath global, and some just include all images as CSS background-images. Maybe the latter is best practice. Should actual img elements be avoided?

Jdlrobson (talkcontribs)

Probably the best thing to do here is to extend the SkinMustache class and the getTemplateData method. The PHP-less skin does have its limitations.

Out of curiosity what images are you wanting to include that are not configurable as footer icons/logo?

Samwilson (talkcontribs)

(Sorry for my slow response.)

SkinMustache sounds good; I'm switching to it now.

I'm adding multiple logos, in different places, as well as some icons (although I guess the latter are perhaps better as background images anyway).

Jdlrobson (talkcontribs)

I also just remembered you can use $wgLogos for this if you need it to be configurable.