[pmwiki-users] Feature request: Action lists in skins

Jonathan Scott Duff duff at pobox.com
Wed Apr 6 16:58:29 CDT 2005


On Wed, Apr 06, 2005 at 10:29:01PM +0200, Joachim Durchholz wrote:
> Patrick R. Michaud wrote:
> >IMO, this is all just because the skin designers aren't designing for
> > i18n.  It's not at all hard to put the $[...] around any label that
> >might need translating into another language.
> 
> Hmm... what will happen if there is no translation? Will $[...] simply
> pass through its contents then?

Yep.

> >And the fact that skin designers aren't considering the needs of
> >i18n, when it's fairly trivial to do so, means it's also likely that
> >skin designers won't consider the complexities/importance of
> >implementing shared actions lists either.
> 
> Funny - I draw the exact opposite conclusion.

My conclusions lie somewhere in the middle :-)

> For example, including the SideBar (not exactly a trivial option
> either) doesn't seem to bother skin designers. Yet it is quite
> complex: it has a nonobvious syntax (when compared to its in-wiki
> equivalent), and it has a mechanism for selecting from a series of
> pages. I believe it's a nonproblem because the boilerplate code is
> already in pmwiki.tmpl, so skin designers who don't wish to bother
> with <!--wiki's complexities simply copy that code and be done
> with it.

Long live cargo-culting! ;-)

> Now that's exactly how an action list markup should work, too. It may 
> offer complex possibilities, but the common cases should be simple. E.g. 
> we have a way to say "action list goes HERE", a way to say "actions in 
> action list should be wrapped with THIS", and a way to say "THIS should 
> go between two actions".
> 
> Technically, this could be done as three markups:
> 
>   <!--function:ActionList-->
>   (action list goes HERE)
> 
>   <!--function:ActionWrapper {{ $action }} -->
>   (action list should be wrapped in {{ ... }} )
> 
>   <!--function:ActionSeparator ~ -->
>   (actions in list should be separated by ~ )
> 
> This sequence
> 
>   <!--function:ActionSeparator ~ -->
>   <!--function:ActionWrapper (( $action )) -->
>   <!--function:ActionList-->
> 
> would then give something like this:
> 
>   (( edit )) ~ (( print )) ~ ((history))
> 
> (In reality, one would probably use some HTML markup instead of ((, )), 
> and ~ .)

So ... where does the action text come from (i.e., "edit", "print",
"history")? And why do "edit" and "print" have whitespace around them
but "history" does not? And how does it know to put them in that order?
And what happens when the user wants one of the actions to be slightly
different than the others? (for instance, how do they get the "print"
action to display in a new window?)

And why three functions when one will do:

<!--function:ActionList sep="~" wrapbegin="((" wrapend="))"-->

that's with the action text magically appearing.  In reality, perhaps
something like this would be better:

<!--function:ActionList 
	sep="~" wrapbegin="((" wrapend="))"
	actions="edit,print,history"
-->

Which convienently gives you the action text and the order that they
should appear.  (Presumably the ActionList function does the i18n for
you too).  All of the parameters to ActionList would, of course, be
optional.

Oh! But presumably this function would also supply the text that the
user clicks on too, right?  I.e., the action text might be "print this
page" but the HTML might say "< href='$PageUrl?action=print'>print
this page</a>".   How would you accomplish that? Here's one plausible
mechanism:

<!--function:ActionList 
	sep="~" wrapbegin="((" wrapend="))"
	actions="edit,print,diff"
	print_text="print this page"
	diff_text="page history"
-->

where the text for the action is just the action itself unless no
action_text is specified.

So far, writing this email has made me lean more towards Pm's side of
the continuum. I've just added so many knobs to this feature that I
might as well have coded the HTML myself. Granted, this is my
interpretation of your idea, but where do you drawn the line of
implementation between simple and common enough that this function needs
to exist and complex enough that it should just be done in the HTML?

And just to compare:

<a href='$PageUrl?action=print'>$[Printable View]</a>
<a href='$PageUrl?action=diff'>$[Page History]</a>
<a href='$PageUrl?action=edit'>$[Edit Page]</a>

vs.

<!--function:ActionList sep=" "
	actions="print,diff,edit"
	edit_text="Edit Page"
	diff_text="Page History"
	print_text="Printable View"
-->

BTW, the HTML was much easier to generate for me because "the
boilerplate code is already in pmwiki.tmpl". :-)

If your (or my) ActionList function were already in pmwiki.tmpl, then
the skin designer would likely have to learn how that markup translates
into HTML in order to use it like they want.  The existing mechanism
is to just copy a snippet of something that's already HTML and tweak
it.

-Scott
-- 
Jonathan Scott Duff
duff at pobox.com



More information about the pmwiki-users mailing list