Content Defender adds more options to define allowed or denied content element types in your backend layouts
This extension can be installed using Composer or the Extension Manager.
composer require ichhabrecht/content-defender
See TYPO3 Documentation - Managing Extensions - Legacy Guide
Restrict certain content element fields
allowed.field = [list of comma separated values]
Examples:
columns {
1 {
name = Column with header and textmedia elements
colPos = 3
colspan = 6
allowed {
CType = header, textmedia
}
}
}
columns {
1 {
name = Column with News plugin only
colPos = 3
colspan = 6
allowed {
CType = list
list_type = news_pi1
}
}
}
Combine multiple content element fields
news
only.Example:
columns {
1 {
name = A column with restricted list_type and "normal" CType
colPos = 3
colspan = 6
allowed {
CType = textmedia, list
list_type = news_pi1
}
}
}
Deny certain content element types
disallowed.field = [list of comma separated values]
Examples:
columns {
1 {
name = Column without divider, plain html and table elements
colPos = 3
colspan = 6
disallowed {
CType = div, html, table
}
}
}
columns {
1 {
name = Column with header and list, without News plugin
colPos = 3
colspan = 6
allowed {
CType = header, list
}
disallowed {
list_type = news_pi1
}
}
}
Limit the number of content elements
maxitems = [number of elements]
Example:
columns {
1 {
name = Column with one textmedia
colPos = 3
colspan = 6
allowed {
CType = textmedia
}
maxitems = 1
}
}
count(): Argument #1 ($value) must be of type Countable|array, null given
Content Defender needs the runtime cache to be available. Please ensure that this cache doesn't use a \TYPO3\CMS\Core\Cache\Backend\NullBackend backend.