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

V.Krishn vkrishn at insteps.net
Sat Jan 16 10:50:58 CST 2010


I think I should have given a live example:
http://insteps.net/pr/a/pmwiki/Cookbook/Infobox-sample2

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' />

Code for it can be found at:
http://www.pmwiki.org/wiki/Cookbook/InfoBox

It is similar to the recipe
http://www.pmwiki.org/wiki/Cookbook/Flipbox
which sets $HTMLHeaderFmt['flipbox']
except that I would want to set both css file and a js file.
-- 
Regards,
V.Krishn

On Saturday 16 Jan 2010 6:06:40 pm you wrote:
> On Friday 15 January 2010 23:48:13, V.Krishn wrote :
> > Setting $HTMLHeaderFmt['myrecipe'] = 'value'
> > from within directive function results in being set after user defined
> > css like local.css..etc.
> >
> > I am thinking of using
> > $array2['styles'] = $HTMLHeaderFmt['styles'];
> > $array2['infobox'] = "link to css";
> > $HTMLHeaderFmt = array_merge($array2, $HTMLHeaderFmt);
> >
> > I hope this would be ok?
> > I would suggest if pmwiki calls the user defined styles to be loaded at
> > the end of execution or can this presently be done by changing some
> > variable?
>
> Normally, a recipe would place directly the CSS in a variable like this:
>   $HTMLStylesFmt['myrecipe'] = 'a.ext {color:green;}'; # [1]
>
> And not in $HTMLHeaderFmt.
>
> This should place the new CSS before local CSS files loaded from pub/css,
> and a wiki could override these locally.
>
> Even better, your recipe could define your styles with SDVA() :
>   SDVA($HTMLStylesFmt, array('myrecipe'=>'a.ext {color:green;}'));
>
> (SDVA = Set Default value in array, unless the value is defined.)
>
> This way, an admin could replace the recipe's CSS via a line like [1] above
> in config.php.
>
> Petko



-- 
Regards,
V.Krishn



More information about the pmwiki-users mailing list