[Pmwiki-users] Modular configurable skin

Patrick R. Michaud pmichaud
Sun Jan 16 11:03:59 CST 2005


On Sat, Jan 15, 2005 at 08:36:48PM -0500, Bronwyn Boltwood wrote:
> I guess we're getting mixed up because not all the examples are
> numbered!  I've been using answer #1 and answer #2 to denote the
> chunks that you labelled as such in your mail, whereas the $CSSToggles
> solution wasn't given a number at all.

Oh sorry, I didn't go back an re-read my original message and was
just trying to follow things based on your excerpt.  Let's start with this:

>   global $HTMLHeadersFmt;
>   $spage = ReadPage('Skin.StyleConfig');
>   preg_match_all('/^link "(.*?\.css)"/m', $spage['text'], $m);
>   foreach($m[1] as $css)
>     $HTMLHeadersFmt[] =
>       "<link rel='stylesheet' type='text/css' href='\$SkinDirUrl/$css' />";

In general, this reads a page called Skin.StyleConfig, finds all of
the lines that begin with

    link "something.css"

and adds <link ... /> lines for each "link" line found in Skin.StyleConfig.

> > Also, does the skin you're working on make much use of floating elements
> > to create various components?  I've found that floats in the outer layout
> > really run into problems when authors want to add floating elements of
> > their own (images, tables) into the page content.
> 
> Static full-width masthead, two floated columns, and a footer that
> clears them.  

The floated columns is likely a problem, because if anyone uses "[[<<]]"
in the markup (used to get past any %align=left% floated images) then
it will actually cause the text to float past the column.

> Floats have bugs in any browser.  

The problems I'm describing with float aren't due to browser bugs,
they're limitations of the float model itself when used to simulate
columns in a page.

> 	-going by some recent reading, browsers for mobile devices and the
> disabled need single-column liquid layouts that put content first, and
> styles which above all do no harm.

My experience has been that the best way to support mobile devices in 
PmWiki is to simply use a different skin altogether (PmWiki makes it easy
to do this), rather than try to come up with a single skin that can handle
them all.  Two simple layouts is probably easier to understand and maintain
than a single ultra-complex one with lots of dependencies.

> Anyway, to use both CSS-based layouts and configurable stylesheets,
> the way I'd like to, I need a way to put a certain list of stylesheets
> in as links, and a different list in as @import rules, or surrounded
> by the appropriate hack or what have you.  I can probably edit the
> $CSSToggles solution to do that (or at least get close), but I don't
> know enough about PHP to figure out the other two.

You want to be adding things to $HTMLHeadersFmt[] then.  This is the
array of text that is added to the output at the point of the <!--HeaderText-->
comment in the template.

Pm



More information about the pmwiki-users mailing list