On Sun, 18 Feb 2007, Patrick R. Michaud wrote:
I think additional directives will make pagelists easer to use. But I'd
prefer to not use (:first:), (:last:) etc, and instead go with
something like (:pagelist-first:), (:pagelist-last:). It's a bit longer
to type, but you won't be doing it that often so I don't see it as a
big problem.
I think it may be too long to type.
I don't agree with that argument at all. In my experience you only spend a
small fraction of your time creating new templates. And for a particular
template, I don't think you will write e.g. (:first:) very many times.
(As an aside, maybe we should have one or more annotated templates for the
pagelist templates? I.e. something that you can copy as a starting point,
and then remove various comments and sections while creating your
template.).
What you gain is clarity - you won't start wondering what (:first:)
would do when not related to a pagelist.
It displays as "(:first:)", of course. Just as "(:pagelist-first:)"
will display as "(:pagelist-first:)" when not related to a pagelist.
:-)
If I'd like to use (:first:) etc for something else, would that work? I
guess one of my (not mentioned) objections is that we use a bit of the
namespace for directives.
I did think of the possibility of qualifying the directives somehow
to make it clear they were for pagelists... but I didn't come up
with anything I liked better than the simple (:first:), (:each:),
and (:last:) choices.
How about
(:pl-first:), (:pl-each:) and (:pl-last:)
I really think it makes sense to show that these directives are related.
(I'm ignoring that the templates can also be used with searchresults)
There's also a bit more to it than this... I'm running into
possibilities for using pagelist-like templates on things other than
pagelists, such as attachlist (but there are others).
You might not remember, but I was the one who suggested using
pagelist-like templates for attachlist a while back ;-) Although, you
weren't to keen on it then as I recall. (Which reminds me that I need to
document a recipe I've created which replaces attachlist)
So, part of me thinks we may be better of sticking with the simple
(:first:)/(:each:)/(:last:) approach instead of trying to explain
(:pagelist-first:) vs. (:attachlist-first:) vs. (:whatever-first:), etc.
In other words, the directives may make sense in contexts other than
pagelists, even if we don't know what those contexts are yet.
If you wish to use the directives for generic lists (btw, I've got a
feeling you might be arguing against one of your princples now), how about
(:list-first:), (:list-each:) etc
Best regards
/Christian
--
Christian Ridderström, +46-8-768 39 44 http://www.md.kth.se/~chr_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users