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

V.Krishn vkrishn at insteps.net
Sat Jan 16 15:45:04 CST 2010


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=.../>"));







More information about the pmwiki-users mailing list