Is it possible to hide 'Add" for a content type from the toolbar?
I dont want to disable it since it should be possible to add it from a URL (and restapi)
Is it possible to hide 'Add" for a content type from the toolbar?
I dont want to disable it since it should be possible to add it from a URL (and restapi)
You can uncheck implicitly addable in the content type, this will stop showing it by default.
Or, change the permission?
Removing the TAL expression seemed logical, but this only changes the link to "createObject" and leads to
2024-10-11 14:53:50,610 ERROR [Zope.SiteErrorLog:17][waitress-2] NotFound: http://localhost:8888/Plone/de/createObject
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 181, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 391, in publish_module
Module ZPublisher.WSGIPublisher, line 269, in publish
Module ZPublisher.BaseRequest, line 529, in traverse
Module ZPublisher.HTTPResponse, line 987, in debugError
zExceptions.NotFound: Cannot locate object at: http://localhost:8888/Plone/de/createObject
Yes (that is what I have done now), but for the folder 'it can be added to', it still shows as 'addable'.
About the TAL expression: where do you 'set it' ?
A tal expression (similar to that of 'log out' etc) would be OK.
Last approach would be to hide it with CSS, but I prefer not to do it that way.
What about using roles/permissions to control it?
How can I do that? Can I set permissions 'just on the add-menu'?
( I want 'someone to be able to add it 'by url', but not by adding it 'from the menu', in other words: If the use (the link) /SomeFolder/++add++MyType they should be able to add it to SomeFolder (but they should not see the menu even when they are in 'SomeFolder' )
The add menu in the toolbar has no separate logic for visibility. If you're allowed to add a type, its in the menu. So with the CSS :has()
selector this is pretty simple to solve (example for Collection
type):
#plone-contentmenu-factories li:has(> a.contenttype-collection) {
display:none;
}