craftcms / docs

Documentation for Craft CMS, Craft Commerce, and other official products.
https://craftcms.com/docs
38 stars 144 forks source link

Element editing docs need updating to include universal element editor and slideouts #434

Closed lukeholder closed 1 year ago

lukeholder commented 1 year ago

Description

Currently the docs instruct the developer to implement the whole edit controller and page if they want to implement a full page element editor (which is no longer required with the universal element edit controller etc). it also makes no mention of slideouts and the methods it needs like Element::getSidebarHtml(). It also mentions a editor HUD and Element::getEditorHtml() which has been removed.

https://craftcms.com/docs/4.x/extend/element-types.html#edit-page

PRs contain some docs: https://github.com/craftcms/cms/pull/10467

AugustMiller commented 1 year ago

Been talking with Brandon about this the last couple of weeks; apt to be one of my next focus areas!

janhenckens commented 1 year ago

Hey all, hope you don' mind me bumping this. I'm running into an issue with a custom element type that is no longer "clickable" in the element overview and I feel like I'm running in circles trying to debug this with the current docs...

Is an update on the way or should I file a regular issue in the cms repo?

AugustMiller commented 1 year ago

I've got some changes queued up in #456, but currently no ETA. The extension docs are still a strategic priority for us, but in practice have had to take a back seat as we get some other 4.x improvements sorted out!

In the interim—I suspect what you've encountered is the absence of a canView() method. This was likely introduced in 4.3.2 when indexes stopped outputting links for Elements that weren't “viewable.” Craft and many plugins have introduced support (either via permissions or the canSave() method or both), but craft\base\Element returns false by default when not implemented in a subclass.

Sorry for the confusion!

janhenckens commented 1 year ago

canView() did the trick, thanks for that!

Hoping to see documentation get more attention again, without that we're unaware of those improvements and that would be a shame. But multiple plates spinning in the air and all that, I can relate :)

AugustMiller commented 1 year ago

Took a second pass at the Element Types page, and it has much better coverage of 4.x features. Closing for now!