svent / pageclasses
Add CSS classes to the body tag - Adding one or more CSS classes to the body tag of the rendered pages. The extension provides inheritance, separate handling of subpages and includes classes for frontend- and backend-layouts.
Package info
github.com/sven-tappert/pageclasses
Type:typo3-cms-extension
pkg:composer/svent/pageclasses
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- typo3/cms-backend: ^14.3
- typo3/cms-core: ^14.3
- typo3/cms-frontend: ^14.3
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- phpcompatibility/php-compatibility: ^10.0.0@alpha
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpunit/phpunit: ^11.5
- saschaegerer/phpstan-typo3: ^3.0.1
- squizlabs/php_codesniffer: ^3.13
- typo3/testing-framework: ^9.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
TYPO3 extension that adds one or more CSS classes to the body tag of the rendered pages. Classes can be set per page and for all subpages of a page, they are inherited down the page tree, and classes for the frontend and backend layout of a page are added automatically:
<body class="home news layout_1 backend_layout_pagets__1col">
Installation
composer require svent/pageclasses
or install the extension pageclasses from the
TYPO3 Extension Repository,
then include the static template "Pagewide CSS Classes (pageclasses)".
| Version | TYPO3 | PHP |
|---|---|---|
| 14.x | 14.3 | 8.2 - 8.5 |
| 13.x | 12.4, 13.4, 14.3 | 8.1 - 8.5 |
| 12.x | 11.5, 12.4 | 7.4 - 8.4 |
Documentation
docs.typo3.org/p/svent/pageclasses/main/en-us/
Development
All checks run in docker containers, see Build/Scripts/runTests.sh -h.
Build/Scripts/testMatrix.sh runs them for every supported TYPO3/PHP
combination. The Fireworks sources of the documentation graphics are in
Build/Sources/Documentation/Images/.
The common tasks are available as Composer scripts (composer list shows
them all, Build/Scripts/runTests.sh -h explains the options):
composer test # lint, PHPStan, PHPCompatibility, functional tests composer test:functional -- -p 8.2 # one check for another PHP version composer test:all # all checks, all combinations composer cgl # fix the coding style (TYPO3 Core rules) composer docs:render # render the documentation composer deps:install # (re)install the dependencies in .Build/ git commit --no-verify # skip the pre-commit checks once
The checks install the dependencies they need on their own, also after
switching branches. deps:install also activates the pre-commit hook in
.githooks/ (or run composer hooks:install). It runs lint, PHPStan and the
functional tests before every commit, and renders the documentation if it is
part of the commit.