On Thu, Mar 6, 2014 at 10:20 AM, Alastair Sherringham <
alast...@sherringham.net> wrote:

> Hello,
>
> I have recently installed MediaWiki 1.22.3 and hope to use it to host
> some documentation. I like the Vector skin and have been using
> Common.css to add some local styling. All looks great so far and I am
> very impressed with Mediawiki.
>
> But I would really like to be able to add a "banner" (or menu etc.) to
> the top of the site, before any standard elements (or possibly sit
> behind them). I would also like to have a basic idea on changing a few
> skin elements perhaps. I have little PHP experience (but some other
> programming languages) so my difficulties are probably stupid and/or
> basic.
>
> Following Daniel Friesen's "subskin" tutorial (thanks Daniel!) :
>
> http://blog.redwerks.org/2012/02/28/mediawiki-subskin-tutorial/
>
> My site is now using my own skin "Zed Docs". Or so it seems to be - it
> is identical to Vector at the moment.
>
> However, I can't seem to figure out how to insert any changes in my skin
> and have them picked up.
>
> I have taken the very basic PHP skin file I created following the
> tutorial :
>
> ZedDocs.skin.php :
>
> require_once( dirname( __FILE__ ) . '/../Vector.php' );
>
> class SkinZedDocs extends SkinVector {
>
>     var $skinname = 'zeddocs', $stylename = 'zeddocs';
>
>     function setupSkinUserCss( OutputPage $out ){
>         parent::setupSkinUserCss( $out );
>         $out->addModuleStyles( "skins.zeddocs" );
>     }
>
> }
>
> and copied much of the rest of the Vector.pnp code below it, changing :
>
> class VectorTemplate extends BaseTemplate {
>     ...
>
> to :
>
> class ZedDocsTemplate extends VectorTemplate {
>     ...
>
> (is this correct?)
>

I don't think this step is correct.  To accomplish a similar end result to
what you're looking for, I did basically the same as you in that I created
a subskin based on the Vector skin.  I did two things differently to get a
header on my new subskin.

1.  Following the php code in myskin.skin.php I simply pasted the HTML for
my header.
2.  I added the CSS to style the header html to screen.css and added a call
to screen.css right after the addModuleStyles statement in the PHP above
with:

$out->addStyle( 'myskin/css/screen.css', 'screen');

I suspect there's a better way to do this, but for now, it's working for me.

I also had to tweak the CSS to make my header fit correctly on the screen
within the framework of the inherited Vector skin styling.  I accomplished
this using Firebug to play with the layout and then editing the CSS by hand
afterward.



> Then inside this, the whole of the "execute" function :
>
> public function execute() {
>     ...
>
> But nothing I add or modify inside the "execute" function makes any
> difference to the page I see e.g. adding anything after :
>
> <div id="mw-page-base" class="noprint"></div>
>
> or anywhere else.
>
> I almost certainly have a fundamental misunderstanding somewhere. No
> doubt coupled with my lack of PHP experience (I know I should really
> learn more about it).
>
> What am I doing wrong and what do I need to do?
>
> Many thanks for any help or advice.
>
> Cheers,
>
>
>
>
> --
> Alastair Sherringham
> http://www.sherringham.net
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to