[pmwiki-users] powertools - pagelist with custom fmt
adam overton
a at plus1plus1plus.org
Wed Sep 17 07:00:05 CDT 2008
okay, so after a little further thought, and after looking at
pagelist.php and powertools, i realize that basically what i need is
a version of pagelist that can iterate through fmt=#mycustomfmt
(which is declared on the LocalTemplates page) just as it normally
would, but without adding a linebreak to each entry... with this
linebreak, no matter what i do, a template like this:
[[#testFmt]]
(:template each:)
{=$Name}\
[[#testFmtend]]
always spits out a vertical list like this:
page1
page2
page3
rather than: page1page2page3
(i can add commas to the template later)
my problem now is that i can't find where in pagelist.php (i'm
assuming in FPLTemplate()) that this newline is being inserted. if i
could locate it, i presume i could copy the main FPLTemplate
function, minus the newline, into a custom template declaration, and
i'll have a nice and accurate list of pages to feed pagecount.
... but i don't see the newline anywhere ...
any hints?
thanks,
adam
On 13 Sep 2008, at 5:31 AM, Hans wrote:
> Saturday, September 13, 2008, 1:08:56 PM, adam overton wrote:
>
>> so again, is it/can it/will it be possible to run {(pagelist)} thru a
>> custom fmt and have it still spit out as a csv?
>
> this seems to be a contradiction in itself.
> If you want a custom formatted output, you won't have a
> comma-separated output.
>
> On the other hand, have a look at powertools.php.
> You could give a different value with fmt=mycustomfmt
> but you need to define what it should be similar to
> $FPLFormatOpt['csv'] = array('fn' => 'FPLSimpleText');
> function FPLSimpleText($pagename, &$matches, $opt) {
> .....
> }
> in powertools.php. I.e you could define
>
> $FPLFormatOpt['mycustomfmt'] = array('fn' => 'FPLMyCustomFmt');
> function FPLMyCustomFmt($pagename, &$matches, $opt) {
> .....
> }
>
> ~Hans
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20080917/564a6c8a/attachment.html
More information about the pmwiki-users
mailing list