[pmwiki-users] Weird one for those that use the attachtable cookbook

Petko Yotov 5ko at 5ko.fr
Sun Oct 18 23:34:19 PDT 2026


[Temporarily the mailing list may not be fully operational.]

On 16/10/2026 20:12, Christopher Cox wrote:
> So, what I did in my recipe to "fix", as it creates artifacts in the 
> per page uploads area where the markup resides. The references behavior 
> of attachtable
> Does MarkupToHTML, instead of using $pagename, I switch to using 
> $sourcepage, where I defined that as:
> 
> $sourcepage = $pagename;
> if (!empty($GLOBALS['MarkupToHTML']['pagename']))
>         $sourcepage = $GLOBALS['MarkupToHTML']['pagename'];
> 
> That seemed to prevent all those reference html gens that attachtable 
> does from creating artifacts inside the page containing attachtable.
> 
> Not sure if this "pmwiki correct" though.
> 

This may work provided that later you also use $sourcepage rather than 
$pagename.

Other markup functions use such a line, without declaring global 
$pagename:

   extract($GLOBALS['MarkupToHTML']);

This populates $pagename and $markupid within the scope of your 
function.

Otherwise there is a recent helper interface $MarkupDirectiveFunctions, 
see:

   https://pmwiki.org/cb/MarkupDirectiveFunctions

Petko




More information about the pmwiki-users mailing list