[pmwiki-users] wikiform ptv change

john.rankin at affinity.co.nz john.rankin at affinity.co.nz
Thu Feb 26 01:14:14 CST 2009


> From: edwin marte <edwin.marte at leidba.com>
> Subject: Re: [pmwiki-users] wikiform ptv change
>
> I am Re-Posting,
> Anybody ?

Sorry for the slow response -- I had a busy few days.
>>
>> Another question has come to my mind. We are implementing some searching
>> mechanism to our wikilist (as Peter Bowers recipes
>> http://www.pmwiki.org/wiki/Cookbook/WikiFormsRecipes ). Everything is
>> working and everything is being done manually. We kind of want to get
>> some
>> statics from the wikilist so we want to be able to access 'count' value
>> as a
>> ptv if possible.
>>
>> The wikiform recipe mentioned that a count value was added (2006), we
>> imagine that this value is the one shown at the bottom of the wikilits
>> with
>> the count of record found.  Is there a way where I can use/pass the
>> value to
>> a PTV ? (if no possible already)

I think I understand exactly why you wish to do this, but cannot see an
easy way to achieve it. at first glance. The difficulty is that the wikilist
directive has to be evaluated to count how many pages meet the search
criteria.

You are correct that this is the count value referenced in the revision
history for the recipe.

The best idea I can come up with is a custom (:wikilistcount:) directive
that does everything (:wikilist:) does except display a list! So we would
modify the code to check if "count" is specified and if so, empty the
output buffer before we output the count.

The alternative (thinking out loud) would be to create a PTV function
that extracts a (:wikilist:) expression from a page, runs it in a special
(:wikilistcount:) mode, and have this special mode return just the
count number.

However, I don't see how either of these approaches can be made to
work in conjunction with Peter's searching mechanism, because the
wikilist doesn't know the search criteria until a searcher submits a
search form.

So I think the answer is that if your wikilist directives are static data,
it *may* be possible, but if they are dynamic based on a searcher
filling in a form, I am struggling to see a way to do it.

Is it possible for me to see what you are doing? Maybe I will think
of something if I see a live example (and maybe not, of course).
Can you send me a link?
>>
>> I apreciate any information you may or anybody else give me in this
>> matter,
>>
>> Our best regards,
>> Edwin
>>
JR





More information about the pmwiki-users mailing list