1

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()) – Indigo Viking Dec 11 '18 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. – Piaras Hoban Dec 11 '18 at 17:31
  • Want to add that as an official answer, @IndigoViking? – Brad Bell Dec 15 '18 at 1:41
2
$view->hook('cp.entries.edit.details', functionThatReturnsView())

Is the correct way in Craft 3.

| improve this answer | |

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.