<br><div><span class="gmail_quote">On 1/26/06, <b class="gmail_sendername">Patrick R. Michaud</b> <<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Jan 26, 2006 at 02:14:04PM -0600, Jon Haupt wrote:<br>> $pn = FmtPageName('$SiteGroup.StyleSheet', $pagename);<br>> $page = ReadPage($pn, READPAGE_CURRENT);<br>> if (!$page) { "page doesn't exist"; }
<br>> $stylesheettext = $page['text'];<br>> $HTMLStylesFmt['skincss'] = $stylesheettext;<br>><br>> Dom<br>><br>> For whatever reason, when I do this, and when I put $SiteGroup.StyleSheet
<br>> into double quotes, nothing happens; the styles are still not applied.<br>> I'm a little confused about the part "relatively to the current page being<br>> browsed"; am I not able to include that kind of thing in
skin.php, maybe?<br><br>Code in skin.php has to declare any global variables before<br>they're used:<br><br> global $SiteGroup, $HTMLStylesFmt;<br><br>(And yes, you still need $SiteGroup.StyleSheet to be in double-quotes.
<br><br>Pm<br></blockquote></div><br>That did the trick, thanks. I've updated Cookbook:CSSInWikiPages with all the new information and released it as 1.0. <br><br>To summarize, you can use this recipe to apply CSS styles to your wiki pages on the fly, by editing a wiki page. Using the (:stylesheet:) markup you can apply styles discriminately to different pages; as well, you can specify that a specific page (
e.g. Site/StyleSheet) be used in all wiki pages in a given skin.<br><br>Jon