[pmwiki-users] css dir
Patrick R. Michaud
pmichaud at pobox.com
Wed Sep 13 21:13:06 CDT 2006
On Wed, Sep 13, 2006 at 09:59:00PM -0400, Henrik Bechmann wrote:
> So the logic would be that the template and php files are loaded
> automatically to "prime the pump" as it were, and the rest is done in
> the above manner, or one of the other methods you prescribe in
> SkinGuilelines. The autoload in a field pubs/css/ could be thought of as
> an easy exception handling, or special case, mechanism.
Just for clarity/accuracy...
- I didn't write SkinGuidelines. :-)
- The "autoload" of pub/css/ is designed to provide a simple mechanism
for site-wide, per-group, and per-page customizations of existing
skins, without having to modify a skin or require every skin
author to implement the code for such
> And all related skin files are kept in the same directory by convention
> for clarity, and ease of maintenance and access.
...and for ease of distribution (e.g., the skins available
> FYI I've put myskin.js in the skin dir as well, for consistency.
Yes, this is an excellent example.
> And I
> plan to have a shared directory in pub/skins/shared (called with
> $PubDirUrl/skins/shared/ -- well actually $FarmPubDirUrl/skins/shared/)
> for shared components.
Unless the shared components are really for "skins", it might make
sense to put them in a subdirectory of pub/ instead of pub/skins/ .
But there's definitely nothing wrong with having a pub/skins/shared/ ,
as long as nobody tries to make a skin called "shared". :-)
> >On Wed, Sep 13, 2006 at 02:17:36PM -0400, Henrik Bechmann wrote:
> >>Patrick R. Michaud wrote:
> >>>I'm a little confused -- you say that the *skin's* css is being
> >>>put into pub/css/Home.FrontPage.css ? Why not have the skin's css
> >>>in the skin directory, as opposed to using the per-page .css
> >>>file in pub/css/ ?
> >>My aim here is to conform to PmWiki standards and practices (and in the
> >>process discover what they are<grin>). So I wanted to cluster the skin
> >>files in the prescribed way, with a minimal amount of code in the
> >>Indeed I had expected to find that if I put myskin.tmpl, myskin.php, and
> >>myskin.css into a skin directory pub/skins/myskin, and set
> >>$Skin='myskin', all the files would get picked up automatically. The
> >>myskin.tmpl and myskin.php do, but myskin.css doesn't (version 2.1.26).
> >Ah, I see. No, PmWiki doesn't automatically pick up any .css files
> >from out of the skin directory; it never really occurred to me that
> >perhaps it should do that. :-)
> >But I'm pretty sure it's better if we let the skin's template (.tmpl)
> >file control the loading of any .css files. This lets the template
> >control the order in which .css files are loaded, as well as making
> >it easy to have some .css files be "optional" (several skins do this
> >So, the "prescribed way" is to use a <link .../> tag in the template:
> > <link rel='stylesheet' href='$SkinDirUrl/myskin.css' type='text/css' />
> >>For one thing, the pub/skins/myskin/myskin.css option isn't mentioned in
> >>the section "CSS Files: Controlling Page Style" at
> >You're correct, that section definitely needs an update
> >(and possibly the page could use some rewriting).
> >>Placing MyGroup.MyPage.css in the field's pub/css/ directory is the only
> >>configuration I could find that gets the skin file picked up
> >And it only gets picked up for MyGroup.MyPage. Other pages won't
> >pick it up.
> >>[...] not what I expected, as the requirement for an explicit
> >>link for the css file seems inconsistent with the auto-load of the other
> >>two files.
> >A valid point that hadn't occurred to me. I've always thought of
> >the .css files as being like .gif images or other graphics that go
> >in the skin's directory, in that they get loaded only when (and where)
> >specified by the template file.
> Henrik Bechmann
> Webmaster, www.dufferinpark.ca
More information about the pmwiki-users