[pmwiki-users] Behaviour of (:pagelist fmt=...:) with bad format argument

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Sun May 28 10:00:04 CDT 2006

On Sun, 28 May 2006, Patrick R. Michaud wrote:

>> What is the indented behaviour of (:pagelist fmt=...:) when it's 
>> argument is incorrect somehow?
>> I think that for instance
>> 	(:pagelist fmt=#doesNotExist count=10:)
>> should result in some kind of error message if the anchors
>> [[#doesNotExist]] and [[#doesNotExistend]] don't exist.
> Note that this somewhat implicates the handling of (:include 
> PageName#doesNotExist:), since they both currently use the same code.

Yes, I thought about that and I want the same behaviour for both the 
default page as well as for a specified page. In fact, I'd also like some 
indication for (:pagelist fmt=doesNotExist:).

> Plus there's my general aversion to "error messages", since error 
> messages always imply a plethora of additional configuration options and 
> workarounds that have to be accommodated.

I know, it's messy. (I've recently bumped into the whole configuration 
mess while working on my extension for (:attachlist:)).

However, in this particular case when you do one of

 	(:pagelist fmt=#doesNotExist:)
 	(:pagelist fmt=Page#doesNotExist:)
 	(:pagelist fmt=doesNotExist:)

I think it's important for the author to see that it failed clearly - I 
don't think the actual text of the error message is important. So I don't 
see it as a major problem if it isn't translated into every language etc. 
Here are some alternatives though:

* Let an incorrect (:pagelist:) not output anything at all

* Let an incorrect (:pagelist:) output an error to some hidden HTML.

* Let an incorrect (:pagelist:) output errors to some variable {$Errors}
   that the skin can decide to show or not show somewhere on the page.
   We could then combine this with some parameter 'uri?verbose=true'
   that would make (:pagelist:) output more detailed information.

* Let an incorrect (:pagelist:) output a small "error" box, which when
   you hold the mouse over it you see the actual error message.

Maybe the idea of an "error box" could be generalized to other directives 
as well?

> First, the name of the "end anchor" doesn't matter -- the fmt=xyz code 
> just reads the section starting with [[#xyz]] and continuing to the next 
> anchor, whatever it happens to be.

Gah... I wish I'd known that, it'd haved saved me quite a bit of typing 
and trouble shooting.  Is this behaviour used with other directives as 

In particular, I use (:include:) a lot and being able to just include up 
to the next anchor would be *very* convenient for me a lot of times.

Btw, perhaps being able to include a certain number of anchors could be 
useful, as in e.g. (:include Page#anchor anchors=3:)

> So, if you're saying that it would be clearer if we had all of the 
> anchors as [[#xyzFormat]] instead of [[#xyz]] -- I don't entirely agree.

No, that's not what I meant. My problem never existed. And you've already 
vanquished it so to speak.


Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

More information about the pmwiki-users mailing list