On Fri, Mar 7, 2014 at 6:44 AM, Daniel Friesen
<[email protected]> wrote:
> On 2014-03-07, 1:13 AM, Alastair Sherringham wrote:
>>> That's probably due to the absolute positioning that Vector's css uses.
>>> You'll have to add some extra css of your own to tweak the top position
>>> of stuff, or add a relative positioned wrapper around vector's normal
>>> content to contain the absolute position within a box you can push down.
>> Yes, I think I need to look at some CSS and re-position.
>>
>> A quick question - Bill's way of adding a header/banner is just to write
>> some HTML directly after the very minimal PHP code as per your tutorial
>> (i.e. after "class SkinZedDocs extends SkinVector {", terminated). This
>> is a much smaller and simpler file obviously that copying all the
>> template code from Vector.php. If one only wants to add a banner/header
>> to the output, is there any reason to do it the "long" way over the
>> short and sweet way?
> Now that I think I actually understand what you're asking I'll answer
> your question.
>
> If I understand it right now, Bill is suggesting that you use:
>
> <?php
> // ...
> class SkinFubar extends SkinVector {
> // ...
> }
> ?>
> <header>
>   My html header code.
> </header>
> ...
>
> This idea is over 9000% wrong. You're not actually adding anything to
> the skin at all.

I have no doubt that this method of getting a header on the page is
incorrect, but I found myself in a position where I simply needed to
re-implement the header from an old MW install in order to upgrade to
1.22.3.  This quick and dirty hack allowed me to move the MW software
forward first and deal with fixing the skin at a later date.

> The html is simply being echoed whenever the php file is loaded, which
> is typically the first time SkinFubar is needed.
> This happens even if the skin isn't used, just as long as it's
> autoloaded, and is not present if the skin is used to render multiple
> pages (like DumpHTML).
>

This definitely happens in my case and causes a slowdown of page load as well.

> In one circumstance this can lead to the "headers have already been
> sent" fatal error as it's possible that the echoed html is output before
> we define our HTTP headers.
> Otherwise, ie: if ob_start() happened to be called and collected that
> text, what happens is this supposed header is really garbage (the
> technical jargon type) that gets output before any of the skin's html is
> output.
>

When I turn on errors, I do see the warning:

Warning: Cannot modify header information - headers already sent by
(output started at <myskin>.skin.php:222) in includes/WebResponse.php
on line 38

> Which really means that your "header" looks about like this:
>
> <header>
>    My html header code.
> </header>
> ...
> <!DOCTYPE html>
> <html ...>
> ...
>
> This html is completely invalid. The entire page <head> is now part of
> an implicitly inserted empty <body>, any class defined on <html> or
> <body> probably won't even target the DOM in your header.
>
> But worse, the DOCTYPE has been completely killed - as it must be the
> first part of the page - which will trigger quirks mode on your wiki and
> - depending on how vector is built - may ruin the skin causing visual
> bugs all over the place that vary from browser to browser, since our
> skins are not designed for quirks mode.

I'd love to fix my custom skin and do it the "right" way, but I'm
still learning.

>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
>
>
> _______________________________________________
> MediaWiki-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to