[pmwiki-users] style sheets order from a directive function

Simon nzskiwi at gmail.com
Sun Jan 17 04:05:24 CST 2010


This is briefly discussed in
http://www.pmwiki.org/wiki/Cookbook/ModuleGuidelines-Talk
<http://www.pmwiki.org/wiki/Cookbook/ModuleGuidelines-Talk>perhaps this
interesting discussion could be preserved on PmWiki too

cheers

Simon


2010/1/17 V.Krishn <vkrishn at insteps.net>

> On Sunday 17 Jan 2010 2:51:10 am you wrote:
> > On Saturday 16 January 2010 20:46:47, V.Krishn wrote :
> > > On Sunday 17 Jan 2010 12:10:23 am you wrote:
> > > > On Saturday 16 January 2010 17:50:58, V.Krishn wrote :
> > > > > Here I would like to load
> > > > >
> > > > > <!--infoboxLibFmt-->
> > > > > <link rel='stylesheet' type='text/css'
> > > > > href='/pub/apps/pmwiki/cookbook/infobox/infobox.css' />
> > > > > .....
> > > > > Before the line
> > > > > <link rel='stylesheet' type='text/css'
> > > > > href='http://insteps.net/pr/a/pmwiki/pub/css/local.css' />
> > > >
> > > > Right, a custom header $HTMLHeaderFmt['recipe'] appears in some cases
> > > > before, in some cases after local.css. I am not sure why.
> >
> > ...
> >
> > > I hoped if pmwiki calls the user defined styles to be loaded at the
> > > end of execution? The idea of having local.css is for overriding syles
> > >  called before.
> >
> > I see. Local css files are appended at the end of $HTMLHeaderFmt in
> > skins.php.
> >
> > When a recipe is included from config.php (that's before skins.php), and
> > adds $HTMLHeaderFmt entries immediately, and they appear before
> local.css.
> >
> > If a recipe adds headers from inside a function called by Markup(), these
> > headers will also be appended to the end of $HTMLHeaderFmt, but that
> > happens after skins.php, so they appear after local.css.
> >
> > Technically, we could move the snippet appending local.css inside the
> > function LoadPageTemplate() just before printing the skin, but then
> recipes
> > will not be able to modify these entries anymore. I'm not even sure there
> > are any such recipes around. I'll think about it.
>
> Thanks.
> I tried workaround [3] and seems to work with multiple recipes.
> If it does not require lots of changes than that would be great,
> but on second thought, the present method gives
> workaround [3] as well the present behaviour.
> Making changes might not allow recipes to revert back to present behaviour.
> I hope my workaround [3] works, would try to do some more tests.
>
> --
> Regards,
> V.Krishn
> >
> > Petko
> >
> > > > There are two workarounds. First is to @import the external
> stylesheet
> > > > from the inline css, like this [1] :
> > > >   SDVA($HTMLStylesFmt, array('myrecipe'=>'@import
> > > > "/path/to/style.css";'));
> > >
> > > I would not go for this method for various implementation reasons...
> > >
> > > > Second workaround is to force your HTML header at the beginning of
> the
> > > > array, before all other entries :
> > > >   array_unshift($HTMLHeaderFmt, array('myrecipe' => "<link
> > > > rel=.../>"));
>
>
>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>



-- 
____
http://kiwiwiki.co.nz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20100117/8e92caec/attachment.html 


More information about the pmwiki-users mailing list