[pmwiki-users] Feature request: Action lists in skins
jo at durchholz.org
Mon Apr 4 17:43:36 CDT 2005
Patrick R. Michaud wrote:
> On Mon, Apr 04, 2005 at 01:43:43PM +0200, Joachim Durchholz wrote:
>>So it would be best to have the skin just specify where the action list
>>should go, but not specify the actions themselves.
> Alas, I have to disagree here. The fundamental, underlying
> premise of PmWiki's skins is that basic skins should be
> easy to design and implement -- i.e., accessible to someone
> that doesn't have a lot of PHP knowledge. I don't want to
> add a lot of special *required* hooks and variables that
> become mandatory for any skin or that leaves a novice skin
> designer wondering what will be generated there.
Let me enumerate the advantages (+) and disadvantages (-) of sticking
with the status quo (as opposed to designing for pluggable action blocks):
+ Skins are simpler to design.
- Every PmWiki administrator must be a skin maker as well
(if only for the action links).
- Upgrading or installing a skin is a hassle.
- It's impossible to show only those actions that are available.
- Skin makers cannot separate design from content.
Action list design wouldn't be too difficult. The advice for skin
writers would be to simply write two sample actions, then replace the
first link with "<!--function:PrintAction" and the second link with "-->".
> Because there are many different ways in which actions
> may be displayed (as a list, via tabs, others),
That's not a real issue. I have checked some skins, and it's always the
same structure: A series of links interspersed with identical
> as well as the fact that different skins may choose to place some
> actions in different locations on a page and not together as a group,
I haven't seen this done yet.
Even if it's done, skin makers can still insert the action link
manually. Nobody would force them to use the action markup.
> I don't think this is something that can be reliably handled via a
> simple "place all actions here" directive.
> Compare, for example, the different locations, formatting,
Locations and formatting all follow the same pattern: there's an action
block, each action wrapped into a <a href> tag (and some additional
markup) and the whole thing concatenated with some "delimiter" markup.
> and content of the action list
There is indeed difference in the content, but it's relatively regular:
* Some actions want specific attributes in their <a href> tags
(mostly access keys and an occasional target="_blank").
(Add a configuration array $ActionLinkAttributes, same keys as
* A skin might want to highlight the active action.
(Define a CSS class for that.)
* Instead of suppressing unavailable actions, a skin might want
to grey them out. (Don't suppress unavailable actions, use a
CSS class - if the skin maker wants suppression, he says
> I don't think they can be easily unified into a single
> <!--Actions--> directive.
I don't see any problems in the flexibility. I haven't seen every skin,
but those that I did see used uniform action blocks (sometimes cleverly
disguised via CSS).
> That said, if skin designers want to create a
> <!--function:PrintActions--> convention to display
> the available actions, I'm not opposed -- but I'm not likely
> to support it as "the" standard either.
That's OK for the moment. If it turns out to be really generally useful,
it can still be turned into an "official" markup later.
More information about the pmwiki-users