[pmwiki-users] Editing CSS and JS files

Jon Haupt jhaupt at gmail.com
Thu Jan 26 15:14:46 CST 2006


On 1/26/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>
> On Thu, Jan 26, 2006 at 02:14:04PM -0600, Jon Haupt wrote:
> >      $pn = FmtPageName('$SiteGroup.StyleSheet', $pagename);
> >      $page = ReadPage($pn, READPAGE_CURRENT);
> >      if (!$page) { "page doesn't exist"; }
> >      $stylesheettext = $page['text'];
> >      $HTMLStylesFmt['skincss'] = $stylesheettext;
> >
> >      Dom
> >
> >    For whatever reason, when I do this, and when I put
> $SiteGroup.StyleSheet
> >    into double quotes, nothing happens; the styles are still not
> applied.
> >    I'm a little confused about the part "relatively to the current page
> being
> >    browsed"; am I not able to include that kind of thing in skin.php,
> maybe?
>
> Code in skin.php has to declare any global variables before
> they're used:
>
>     global $SiteGroup, $HTMLStylesFmt;
>
> (And yes, you still need $SiteGroup.StyleSheet to be in double-quotes.
>
> Pm
>

That did the trick, thanks.  I've updated Cookbook:CSSInWikiPages with all
the new information and released it as 1.0.

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.

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060126/49403229/attachment.html 


More information about the pmwiki-users mailing list