[pmwiki-users] noleft query in skin.php for CSS change
Petko Yotov
5ko at 5ko.fr
Thu Nov 8 15:22:15 CST 2012
Oliver Betz writes:
> >so you could check for that in your skin.php to trigger your style
> >injections:
> >
> >if ($GLOBALS['TmplDisplay']['PageLeftFmt']==0)
> > { $HTMLStylesFmt['[...'] = ....; }
>
> that's what I tried before I asked here. It doesn't work, the
> expression always evaluates "true".
Actually, the variable $GLOBALS['TmplDisplay']['PageLeftFmt'] is not yet
defined when your skin.php file is loaded, because the wikitext has not yet
been processed.
If this evaluates as true, it is probably because of the non-strict compare
("unset variable" compared to a number will be internally considered a
number, which is zero).
If you use a strict compare with === instead of ==, it will always evaluate
as false.
Other skins redefine the '(:noleft:)' directives in order to be able to
detect when they are used. For an example, see the Monobook skin.
At the moment, I don't see another way to do it.
Petko
More information about the pmwiki-users
mailing list