[Pmwiki-users] Re: CSS links under 0.6.1 or later (Patrick R. Michaud)

dave.jackson dave.jackson
Tue Feb 24 08:20:47 CST 2004


Before acting on this e-mail or opening any attachments you are advised to read The Caudwell Holdings group of companies' disclaimer at the end of this e-mail. 
--------------------------------------------------------
 
 
  
  


>When 0.6.beta came out and the css worked exactly the same way, I
jumped up and down and danced a jig of glee; that is just >the kind of
person I am.

>I would love to see this put back in place so that $HTMLHeaders is
automatically populated with stylesheets in the following >order if they
exist in the /pub/css/ directory.

>  1) local.css
>  2) $Group.css
>  3) $Group.$Page.css


See ExternalCSS in the cookbook.


I updated the code a while a go but never posted it up...
This needs updating again to match 0.6.x conventions, but hey, that
should be trivial... 

$group=''; $title='';
if (preg_match("/^($GroupNamePattern)([.\\/]($PageTitlePattern))?\$/",
    $pagename,$match)) {
  $group = $match[1];
  $title = @$match[3];
}

/*
    This block of code 'links' to the external sheets
    Note the the $PathToLocal variable must be set from the root
    of the site to the local folder.

    i.e. if the sheets are in http://www.yoursite.com/wiki/local
    set $PathToLocal = "/wiki/";
*/
$PathToLocal = "/wiki/";
$HTMLHeaderFmt = "\n";
$CSSFiles=array("local/wiki.css","local/localStyle.css","local/$group.cs
s","local/$group.$title.css");
foreach($CSSFiles as $cssfile) {
  if (@!($cssfd=fopen($cssfile,"r"))) continue;
    $HTMLHeaderFmt .= "<link type=\"text/css\" rel=\"stylesheet\"
href=\"$PathToLocal$cssfile\">";
    $HTMLHeaderFmt .= "\n";
}


Dave Jackson 
  
--------------------------------------------------------
 
 
Confidentiality Notice 
This e-mail is confidential and intended for the use of the named recipient only. If you are not the intended recipient please notify us by telephone immediately on +44(0)1782 600600 or return it to us by e-mail. Please then delete it from your system and note that any use, dissemination, forwarding, printing or copying is strictly prohibited. Any views or opinions are solely those of the author and do not necessarily represent those of The Caudwell Holdings group of companies. 
 
Encryptions and Viruses 
Please note that this e-mail and any attachments have not been encrypted. They may therefore be liable to be compromised. Please also note that it is your responsibility to scan this e-mail and any attachments for viruses. We do not, to the extent permitted by law, accept any liability (whether in contract, negligence or otherwise) for any virus infection and/or external compromise of security and/or confidentiality in relation to transmissions sent by e-mail. 
 
Monitoring 
Activity and use of The Caudwell Holdings group of companies' systems is monitored to secure its effective use and operation and for other lawful business purposes. Communications using these systems will also be monitored and may be recorded to secure effective use and operation and for other lawful business purposes. 
 



More information about the pmwiki-users mailing list