[Pmwiki-users] Skins

Bob Dively dive
Sun Feb 22 00:48:36 CST 2004


Steven Leite said:

> I believe it's important to keep the {{...}} (or some alternative).  As
> a designer, I expect things to stand out from the rest of the code if
> they going to be replaced later on.
>
> Escaping the $, or forcing the Admin to use $$ to mean $ is a perfect
> example of  we should not be doing.  Image somebody putting some a table
> of prices in $Dollars as part of a template.  As programmers, we need to
> cater to the user, not the other way around.

If $VarName is going to be evaluated, then you have to escape $ in some
way if you want the just character to appear in the html output (unless
you force the user to use $ which I think is a bad solution). The
need to escape characters is always going to arise in any templating
system. You could use a more complex variable structure like {{$VarName}}
but you'd still need some way of escaping even that. The important thing
is to find a balance between convenience and function. Personally, my
preference is for just just $VarName, but by a very slim margin because
typing {{$VarName}} wouldn't be that much of a burden.

(BTW, if $VarName were used and $ was escaped as $$, you'd just use
$$$Dollars in the template. This looks easy to me, but then I've been
coding for years in ColdFusion which evaluates things inside of #
characters, so I see ###VarName# fairly often.)

> Also, In another post, one user suggested one template for the edit
> page, one for the search page, etc.  This is OK (for those that want
> it), but it should be optional.

That was me. I only suggested it because PM had indicated that it might be
hard to have a templating system because of the way in which PmWiki
creates html. I think it would be best to have one template for all page
types.

> file.  The other two files, PmWiki reads in, interprets, and spits out
> as HTML.  Couldn't we do something about that pesky .css file?  Either
> get PmWiki to write a copy in the /pub/css so the Admin doesn't have to
> do it, or read it in to memory, and/or do something with it (like embed
> it in HTML).

You definitely don't want to embed it in the HTML because then you're
sending the css with every request instead of letting the browser cache
it.

I think that files that are directly requested by the client should be in
the /pub directory - css, images. Files to which the client shouldn't have
access should be in the local directory - configs, etc. An admin would
have to maintain two separate directory structures for a given config +
skin, but I don't think that's much of a burden.

> Question:  Since php can be embedded in html, wouldn't that almost
> completely eliminate the need for the MyGroup.php file (assuming you had
> a MyGroup.htm template)?  Sad, I kinda liked the idea of having a
> (simple) html template, and a seperate (and optional) .php Group
> configuration file.

You definitely need to separate configuration from templating. There are
plenty of cases in which you might want to maintain the same config
information, but use a different template or stylesheet to change the
layout of the page.

-b





More information about the pmwiki-users mailing list