Forum

Thread tagged as: Problem, Add-on-development

App Upgrade Help

Hello,

Just wondered whether you could point me in the right direction, I'm in the process of updating my apps, when listing rows I need to add a button, I've found add_misc_action which outputs the button, but the path doesn't come through href is empty on output.

Can you advise?

$Listing->add_misc_action([
        'class'  => 'success',
        'title'  => 'Download',
        'inline' => true,
        'path'   => '?download=',
      ]);
Dexter Harrison

Dexter Harrison 29 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

As we don't know how to form the link for a misc action, you need to pass a callable that does the job.

e.g.

'path'     => function($Item) use ($Region) {
                    return PERCH_LOGINPATH.'/core/apps/content/revisions/revert/?id='.$Region->id().'&rev='.$Item->itemRev();
                },

Perfect thank you,

Can I do similar on the edit_link on add_col?

I've done the same but it appends /?id=X

Can I stop that, I need to add another query string.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No I think those are designed to work with our standardised paths.