-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Disable to remove Code defined Part or PartField #13335
Comments
May be we need to disable |
@hishamco there was ones a PR (#11737) that we ended up closing that would allow the use to disable listing that content item in the UI. However, it was decided that we did not want to take it. The problem is that content definition can be altered in many way like migration, recipe, UI and probably API too or even workflow. @hyzx86 if you create a controller that require a content type to work, you can check the definition manager to see if that content type exists before you continue. If you have a part that is critical to a type, you may want to make that part a C# type not based on fields. Then, you can weld that part the content item using a handler. This will ensure that your type always has it and the user is unable to remove it or manage it via the UI. |
Thanks that my memory is not volatile :) I remembered there's a PR related to you
If the content definition is altered I presume it should affect the UI, right? |
yes the UI render based on the content definitions. but if he creates a C# part, then it won't be part of the definition and it won't show up on the UI. And since he would be using handler to attach the part, the user has no way to altering the behavior. |
I didn't try it but I presume it should reflect while it affect the same content definition |
I had an idea, like when we register a type in the code, we also register the name of the type with the scope, if this feature is enabled, then this Part will not be able to be removed
If this feature is turned off, we can remove the type that only solves part of the problem |
If you follow my last approach, you'll have a solution that works. You register your custom part, driver and a handler in the feature you want to use. When that feature is enabled, that part is auto weld to the content type you set in the handler. If we disable that part, everything goes away. |
Currently we have many
ContentTypes
orParts
defined inFeature
.Just like
Menu
,List
,Taxonomy
, etc.If remove some
ContentTypes
orParts
through the admin dashboard, it may cause problems with the functionality that depends on these definitions, and there seems to be no way to distinguish between them at the momentIs there any way to check if the
ContentTypes
,Parts
orPartField
is already defined in the code? To hide the delete buttonThe text was updated successfully, but these errors were encountered: