<br><div><span class="gmail_quote">On 1/26/06, <b class="gmail_sendername">Patrick R. Michaud</b> &lt;<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>&gt; 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>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$pn = FmtPageName('$SiteGroup.StyleSheet', $pagename);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$page = ReadPage($pn, READPAGE_CURRENT);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!$page) { &quot;page doesn't exist&quot;; }
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$stylesheettext = $page['text'];<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$HTMLStylesFmt['skincss'] = $stylesheettext;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dom<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;For whatever reason, when I do this, and when I put $SiteGroup.StyleSheet
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;into double quotes, nothing happens; the styles are still not applied.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;I'm a little confused about the part &quot;relatively to the current page being<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;browsed&quot;; 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>&nbsp;&nbsp;&nbsp;&nbsp;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.&nbsp; I've updated Cookbook:CSSInWikiPages with all the new information and released it as 1.0.&nbsp; <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.&nbsp; 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