Open baschny opened 4 weeks ago
The context menu adds a new Content Element to the page, not the container - so the list of all available content elements would be correct if you haven't restricted your page's backend_layout
Technically I understand why it does that, but it does not make sense to the editor, because he will not get the content where he expects it (right after the one he clicked on) in case the element he is clicking it is inside a container.
This bug/feature request would be either to hook into this context menu and add a tx_container_parent=xx
parameter to the record/content/wizard/new
wizard, or simply remove this context menu entry altogether - to avoid editor confusion / frustration.
Ah I see what you mean - just tested this and can confirm, the list of available types is not correct if you click the context menu on an element inside a container
TYPO3 will prevent you from saving though if you create an element that is not allowed
To add, I think the problem lies in EXT:content_defenders WizardItemsHook, which only checks backend_layouts
Edit: No, you're right - the tx_container_parent param is missing from the requests query-params
@baschny added a PR (works for me now with content-defender), can you test that?
@thomasrawiel works great, thanks!
Having a container setup using content_defender to restrict certain containers to certain content elements.
In the Web>Page view the editor has two ways of creating new content:
(1)
+ Content
button (2) the "More options..." >'Create New' wizard
from the context menuUsing the first option restricts the content elements as expected:
Using the second option (the "wizard" from the context menu), the editor is presented with a list of all available content elements:
This should be the same list.
Another (maybe easier) option would be to simply remove the context menu item, because its redundant anyway.