ichhabrecht / content-defender
Define allowed or denied content element types in your backend layouts
Installs: 1 960 895
Dependents: 12
Suggesters: 1
Security: 0
Stars: 85
Watchers: 10
Forks: 38
Open Issues: 37
Type:typo3-cms-extension
Requires
- php: ^8.1
- typo3/cms-backend: ^11.5 || ^12.4 || ^13.4
- typo3/cms-core: ^11.5 || ^12.4 || ^13.4
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.4
- phpspec/prophecy: ^1.12.1
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^10.5
- typo3/cms-fluid-styled-content: ^11.5 || ^12.4 || ^13.4
- typo3/cms-indexed-search: ^11.5 || ^12.4 || ^13.4
- typo3/cms-workspaces: ^11.5 || ^12.4 || ^13.4
- typo3/minimal: ^11.5 || ^12.0 || ^13.0
- typo3/testing-framework: ^7.0.4 || ^8.2.3
Replaces
- typo3-ter/content-defender: 3.5.1
- dev-main
- 3.x-dev
- 3.5.1
- 3.5.0
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-pre-merge
- dev-premerge/compatiblity-13
- dev-feature/show-maxitems-in-pagemodule
- dev-feature/improve-container-integration
- dev-change-hook-api
- dev-support-columns-without-colpos
This package is auto-updated.
Last update: 2024-12-09 14:51:24 UTC
README
Content Defender adds more options to define allowed or denied content element types in your backend layouts
Installation
This extension can be installed using Composer or the Extension Manager.
Composer
composer require ichhabrecht/content-defender
Extension Manager
See TYPO3 Documentation - Managing Extensions - Legacy Guide
Usage
- You only need to adjust the column configuration of your backend_layout
Restrict certain content element fields
- To allow a limited set of values for content element fields use
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
- The example allows multiple content element types (text and list) while restricting plugin types to
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
- To remove a set of values from content element fields use
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
- To restrict the number of content elements use
maxitems = [number of elements]
Example:
columns {
1 {
name = Column with one textmedia
colPos = 3
colspan = 6
allowed {
CType = textmedia
}
maxitems = 1
}
}
Known issues
TypeError
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.
Community
- Thanks to b13 that sponsored the maintenance of this extension with a sponsorship
- Thanks to Wolfgang Wagner who sponsored the maintenance of this extension with a sponsorship
- Thanks to WACON Internet GmbH that sponsored the maintenance of this extension with a GitHub sponsorship
- Thanks to Daniel Goerz who wrote about content_defender in his blog useTYPO3
- Thanks to Marcus Schwemer who wrote about content_defender in his blog TYPO3worx