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)


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>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.