Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lukeholder opened this issue Oct 26, 2022 · 5 comments

Comments

@lukeholder
Copy link
Member

lukeholder commented Oct 26, 2022

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: craftcms/cms#10467

@AugustMiller
Copy link
Contributor

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

@janhenckens
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants