[pmwiki-users] Attachlist configuration

david at ellendee.co.uk david at ellendee.co.uk
Mon Dec 2 00:11:15 PST 2019


Thanks again Petko. Your advice was perfect as usual. I've now got more or
less what I wanted. https://classic-sf.com/Titles/DownloadStories

Regards

Dave Cooke

-----Original Message-----
From: Petko Yotov <5ko at 5ko.fr> 
Sent: 27 November 2019 15:13
To: david at ellendee.co.uk
Cc: 'PMWiki' <pmwiki-users at pmichaud.com>
Subject: Re: [pmwiki-users] Attachlist configuration

On 27/11/2019 16:01, Petko Yotov wrote:
> There is currently no concise/succinct way to configure the output of 
> Attachlist, you need to override and redefine the whole markup 
> directive.

This will redefine (:attachlist:) and will work for the pages where this
markup is already present (like the default ?action=upload form).

If you prefer, the same way you can define a new markup directive while also
keeping the existing one. In that case, change the first and the third
argument to the Markup() call:

   Markup('myattachlist', 'directives',
     '/\\(:myattachlist\\s*(.*?):\\)/i',
     "DavidMarkupFmtUploadList");

and in a wiki page use the other directive (:myattachlist:).

See for example in the cookbook how FileList and Attachtable implement it.

Petko

> Something like this in config.php:
> 
>   Markup('attachlist', 'directives',
>     '/\\(:attachlist\\s*(.*?):\\)/i',
>     "DavidMarkupFmtUploadList");
>   function DavidMarkupFmtUploadList($m) {
>     extract($GLOBALS["MarkupToHTML"]); # get $pagename
>     return Keep('<ul>'.DavidFmtUploadList($pagename,$m[1]).'</ul>');
>   }
> 
>   function DavidFmtUploadList($pagename, $args) {
>   ## copy here the code from upload.php:FmtUploadList()
>   ## and adapt it for your needs.
> 
>   }
> 
> Petko
> 
> On 27/11/2019 15:28, david at ellendee.co.uk wrote:
>> Is there any way to configure output from Attachlist. I am especially 
>> interested in supressing file details and would like to reconfigure 
>> in the possible using fmt= with pagelist.
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users


This email has been scanned by BullGuard antivirus protection.
For more info visit www.bullguard.com





More information about the pmwiki-users mailing list