I'm looking to add a custom fields to the details section on the right of the entry edit view in the control panel.

I know that in Craft 2 this was possible using: Craft::$app->view->hook('cp.entries.edit.details', functionThatReturnsView())

Is there a more Craft 3 way to do this or do we still use the Craft 2 API for this kind of extension to control panel?

  • Have you tried $view->hook('cp.entries.edit.details', functionThatReturnsView()) Dec 11, 2018 at 13:07
  • Yep, and it works. But it seems strange that it would be done that way, would have expected it to follow the Craft 3 way of doing things. Dec 11, 2018 at 17:31
  • Want to add that as an official answer, @IndigoViking?
    – Brad Bell
    Dec 15, 2018 at 1:41

1 Answer 1

$view->hook('cp.entries.edit.details', functionThatReturnsView())

Is the correct way in Craft 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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