IchHabRecht / content_defender

Define allowed or denied content element types in your backend layouts
GNU General Public License v2.0
84 stars 38 forks source link

Web>List module: All content elements allowed #159

Open cweiske opened 1 month ago

cweiske commented 1 month ago

When creating a new content element via Web > List > Table "Page Content" > New record, all content elements are shown in the new content element wizard.

The backend layout of this page has only 1 row with 1 column, and that column only allows a single content type.

Shouldn't content_defender limit the new content element wizard from the list view, too?

Example:

mod.web_layout.BackendLayouts.service {
    title = Service list
    config {
        backend_layout {
            colCount = 1
            rowCount = 1
            rows {
                1 {
                    columns {
                        1 {
                            name = Services
                            colPos = 1
                            allowed {
                                CType = mask_services
                            }
                        }
                    }
                }
            }
        }
    }
}
sebkln commented 3 weeks ago

When using the "New record" button in List view, the Wizard first lets you choose the type of content element, then the position (colPos) of this element. Therefore, you cannot limit the list of available content elements in the first step. Maybe this extension could be extended to limit the available columns in the second step.

Current state: if an editor chooses a content element that is not allowed in the selected column, the content element will automatically fall back to the first found allowed CType in the list.