[Pmwiki-users] Modular configurable skin

Hans Bracker design
Sun Jan 16 05:59:45 CST 2005


Patrick wrote:

All that said, at present the easiest way to toggle CSS components is
through a config.php or skin.php file, and I'm fairly sure that nearly
every admin will be editing that...

    $CSSToggles[] = array(
      # uncomment any of the below to enable
      # 'font-face-verdana.css',
      # 'font-face-times_new_roman.css',
      # 'font-face-h_georgia-b_verdana.css',
      # 'sidebar-orientation-left.css',
      # 'sidebar-orientation-right.css',
      );

    foreach($CSSToggles[] as $c) 
      $HTMLHeadersFmt[] = 
        "<link rel='stylesheet' type='text/css' href='\$SkinDirUrl/$c' />";

end quote.

for use in your skin.php add
    global $HTMLHeadersFmt, $CSSToggles;

This is the total solution for toggling various style sheets.
if you keep the code on your skin.php file you can just rename the
stylesheets to whatever you got in your custom skin directory.
No other action needed. And not loading the stylesheet via a line in
your template file.

it is just up to you that the order is correct and that they are not
mutually destroying each other :)

Best
~Hans




More information about the pmwiki-users mailing list