3

I want to do something similar to this answer but for Craft 3 (eg. render some custom HTML in the Entry editing screen). I can't work out how to do this with the changed Craft 3 hooks.

Should this be registered as an event now? What class/event ID should I be using to add code to cp.entries.edit.details?

(I'm new to Craft plugin dev so a little unclear how to proceed here)

Matt Andrews
  • 247
  • 1
  • 8

1 Answers1

5

Figured it out after browsing some existing plugins' source:

Craft::$app->getView()->hook('cp.entries.edit.details', function(array &$context) {
    return '<a href="#" class="btn">My Button!</a>';
});
Matt Andrews
  • 247
  • 1
  • 8