Page MenuHomeMiraheze

Add Header Extension on hlptest.miraheze.org
Closed, ResolvedPublic

Description

I'd be most grateful if you could enable the Header Extension on hlptest.miraheze.org

https://www.mediawiki.org/wiki/Extension:Header

What I'm hoping to achieve is to replicate the banner at the top of https://www.healthylondon.org/ on the wiki, i.e. replicate this bit at the top of every page

https://www.dropbox.com/s/y21ky5gxe41n6rc/Screenshot%202017-04-26%2011.44.52.png?dl=1

Many thanks in advance
Best, Sam

Event Timeline

@Tansaku this extension needs a security review. However, you can just use MediaWiki:Sitenotice to display a message across the top of every page

Thanks @Amanda - I did that, but it doesn't quite achieve the effect I want:

https://www.dropbox.com/s/m5h9hpdw10xibea/Screenshot%202017-04-26%2012.25.43.png?dl=1

I don't want a notice on every page - I want a completely different banner with images and links that runs from one side of the screen to the other - is that possible?

What I'm hoping to achieve is to replicate the banner at the top of https://www.healthylondon.org/ on the wiki, i.e. replicate this bit at the top of every page

https://www.dropbox.com/s/y21ky5gxe41n6rc/Screenshot%202017-04-26%2011.44.52.png?dl=1

@Tansaku unfortunately Miraheze does not accept any banners or other advertisements

thanks @Amanda - I'm not trying to add an advert or advertising banners - just branding for the site itself - does that make sense?

I think so. In any circumstance the extension still needs review

So while I've approved Extension:Header, I strongly urge you not to use it. I assume you want to add some HTML inside the <body> of the page, not before the <html> tag, right?

The correct thing to do here would be to write a small extension that does something like this:

$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'MyExtensionHooks::onSkinTemplateOutputPageBeforeExec';

// And inside a class...
public static function onSkinTemplateOutputPageBeforeExec( &$skin, &$template ) { ... }
    global $wgHeaderExtensionHTML;
    // OutputPage::headElement actually creates the opening <body> tag, so this goes right after
    $template->extend( 'headelement', $wgHeaderExtensionHTML );
    return true;
}

As this would be way easier to do than to write a whole other skin. If you need to add some CSS here, outside of using Common.css, you'd have to use a different hook (or well, preg_replace but don't do that either ?), but that's entirely optional.

Reception123 mentioned this in Unknown Object (Diffusion Commit).May 20 2017, 11:06
Reception123 claimed this task.

CustomHeader implemented (https://github.com/Miraheze/CustomHeader), installed and enabled on wiki