psbits / frontend-templates
Frontend templates for TYPO3: page layouts, content elements, ViewHelpers and TypoScript setup, built on Bootstrap and Content Blocks
Package info
github.com/phantasie-schmiede/frontend-templates
Language:SCSS
Type:typo3-cms-extension
pkg:composer/psbits/frontend-templates
Requires
- php: ^8.3
- ext-intl: *
- friendsoftypo3/content-blocks: ^1.5 || ^2.4
- psbits/foundation: ^4.2.2
- psbits/view-helpers: ^4.0
- symfony/intl: ^7.1
- typo3/cms-core: ^13.4 || ^14.3
- typo3/cms-fluid-styled-content: ^13.4 || ^14.3
- typo3/cms-install: ^13.4 || ^14.3
- wapplersystems/ws-scss: ^13 || ^14
Requires (Dev)
- ergebnis/composer-normalize: ^2.56
- friendsofphp/php-cs-fixer: ^3.95
- helmich/typo3-typoscript-lint: ^3.3
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^11
- psbits/qa: @dev
- roave/security-advisories: dev-latest
- saschaegerer/phpstan-typo3: ^2.1 || ^3.0
- typo3/testing-framework: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-20 15:53:28 UTC
README
Basic templates for TYPO3 providing page layouts, content elements, Fluid ViewHelpers, and TypoScript setup — built on Bootstrap with Content Blocks.
Requirements
| Dependency | Version |
|---|---|
| TYPO3 CMS | 13.4 / 14.3 |
| PHP | 8.3 – 8.5 |
| psbits/foundation | 4.2.2 |
| psbits/view-helpers | 4.0 |
| friendsoftypo3/content-blocks | 1.5 / 2.4 |
| wapplersystems/ws-scss | 13 / 14 |
Installation
composer require psbits/frontend-templates
Activate the site set in your site configuration, or add it as a dependency of your own site set:
# config/sites/your-site/config.yaml dependencies: - psbits/frontend-templates
Content Elements
Eleven content elements are provided via Content Blocks:
| Element | Description |
|---|---|
| Hero | Full-width hero section with background image, text overlay, optional CTA link, and configurable text alignment. |
| Slider | Image carousel (Swiper) with configurable pagination, navigation arrows, loop, and eager loading. |
| Logo Slider | Auto-playing logo carousel with grayscale option; ideal for partner/client showcases. |
| CTA | Call-to-action button with selectable Bootstrap color type (primary/secondary/etc.), size, and full-width option. |
| Contact Lead | Introductory section above a contact form with configurable success/error messages and emphasis style. |
| FAQ | Collapsible FAQ section with an optional intro text and a collection of question/answer pairs. |
| Feature | Content section with image and bodytext; layout variants (image left/right/stacked) and background variants (default/light/dark). Optionally links to CTA elements. |
| Teaser Grid | Grid of teaser cards with optional category-based filtering, rendered from child content elements. |
| Accordion | Expandable sections in flush or card style, built from child content elements. |
| Info box | Key facts as label/value pairs, optional introduction and link; information or important-notice appearance. |
| Quotation | Highlighted plain-text quotation with optional author and role/source attribution. |
All content elements include German and English labels (language/de.labels.xlf, language/labels.xlf).
Editorial news articles
Enable contentElementRelation in the News extension settings to compose articles from ordered content elements.
The detail template renders the teaser first, then the content elements, then the optional News bodytext. For an
article with images, quotations and info boxes between paragraphs, put the entire article body in the ordered
content elements and leave the News bodytext empty. Existing bodytext-only articles remain supported.
The News renderer wraps each element in .news-detail-element for consistent spacing and compact Feature layouts
within the readable text column. Responsive images display the file reference's description as a caption, with
file metadata as fallback; alternative text and copyright remain separate.
Info boxes accept up to twelve sortable facts and an optional link with a separate link label. They do not copy dates or locations from Calendarize: when using them for announcements, keep event details in the calendar and link there, or check manually entered facts before publication. Quotations are plain text; identify the author and source, and never attribute editorial sample statements to real people.
After installing new blocks, update the TYPO3 database schema to add their generated fields and the facts table.
Page Templates (Backend Layouts)
Sixteen backend layouts are registered in Configuration/TSconfig/Page/Includes/BackendLayouts/, each mapping to a Fluid template in Resources/Private/Templates/Page/ and a layout in Resources/Private/Layouts/Page/:
| Layout | Description |
|---|---|
| Blank | Minimal page without header/footer — useful for landing pages. |
| OneColumn | Single full-width column. |
| TwoColumns-1-1 / 1-2 / 2-1 / 1-3 / 3-1 | Two-column layouts with various width ratios. |
| OneColumnTwoColumns-1-1 / 1-2 / 2-1 | Full-width top row followed by two columns. |
| ThreeColumns-1-1-1 / 1-2-1 | Three equal or varied-width columns. |
| OneColumnThreeColumns-1-1-1 / 1-1-1 | Full-width top row followed by three columns. |
| OneColumnThreeColumns-1-2-1 | Full-width top row, centered middle column, two side columns. |
| Grid-2x2 | Four equal cells in a 2x2 grid. |
Content is delivered via colPos positions: 0 (content1), 1 (content2), and 100 (stage content, used by hero/slider).
TypoScript Settings
Settings are configured in the TypoScript constants module under plugin.tx_frontendtemplates.settings:
| Setting | Type | Description |
|---|---|---|
alternativeWebsiteTitle |
string | Alternate website title used in Fluid layouts. |
logos.default.file |
string | Default logo image reference. |
logos.default.height |
int | Default logo height. |
logos.default.width |
int | Default logo width. |
logos.default.showWebsiteTitle |
bool | Show the website title alongside the logo. |
logos.favicon |
string | Favicon image reference. |
navigation.footer |
int | Page ID for the footer navigation. |
The site set also provides crop variant configuration for desktop, tablet, and mobile (via Configuration/Sets/Template/page.tsconfig).
SCSS Color Variables
Eight Bootstrap color variables are configurable via ws-scss constants (plugin.tx_wsscss.variables): primary, secondary, success, danger, warning, info, dark, light.
Global Template Variables
Global variables are available in Fluid via the templates namespace:
templates:globalVariables.currentPage()— the full current page record.templates:globalVariables.settings()— extension settings, includingheaderButtons(a collection of header button records resolved from the page rootline).
ViewHelpers
templates:svgIcon
Renders inline SVG from the TYPO3 icon registry, with optional custom dimensions and additional CSS classes.
<templates:svgIcon identifier="content-info" width="24" height="24" />
templates:component.button
Renders a <button> or <a> element with optional icon (via svgIcon), spinner text, and external-link handling. Supports Bootstrap button styling via CSS classes.
<templates:component.button href="/contact" iconIdentifier="content-contact" label="Get in touch" />
templates:component.progressBar
Renders a Bootstrap progress bar with automatic color coding (green/yellow/red) based on percentage. Accepts minValue, maxValue, and value.
templates:format.reduceWhitespace
Trims and collapses whitespace in its child content — useful for minifying inline header HTML.
templates:data.countryNames
Returns a country name by ISO 3166-1 alpha-2 code, or all country names when called without arguments.
templates:event.additionalContent
Dispatches a PSR-14 event implementing AdditionalContentEventInterface and returns the resulting content string. Used to inject dynamic content into templates.
templates:page.header
Adds arbitrary HTML to the TYPO3 page header, deduplicated by identifier. Supports inline content (html attribute) or child content.
templates:page.rowHighlightClass
Returns a CSS class name based on the row highlight setting of the current page (for use in backend layout row styling).
templates:image.aiStatus
Returns the AiStatus enum value (Created, Modified, or None) from a file reference's tx_frontendtemplates_ai_status property.
templates:image.aspectRatio
Computes and returns the aspect ratio (width / height) of a file reference, respecting crop variant settings.
Extensibility
The extension provides a PSR-14 event system for additional content. Create a class implementing
PSBits\FrontendTemplates\Event\AdditionalContentEventInterface (extend AbstractAdditionalContentEvent for convenience), register it in Configuration/Services.yaml, and dispatch it via the templates:event.additionalContent ViewHelper.
Third-Party Extension Overrides
Fluid templates and partials for News (georgringer/news) and Calendarize (lochmueller/calendarize) are overridden in Resources/Private/Extensions/ to apply consistent styling. Layout and partial paths are configured in Configuration/TypoScript/Includes/Setup/extensions.typoscript.
Upgrade to 0.2.0
The extension field prefix changes from tx_templates_ to tx_frontendtemplates_.
Back up the database, then add the new fields using the database analyzer without
removing the old fields. Run the PSBits Frontend Templates: migrate extension field
prefixes upgrade wizard in the Install Tool, or use:
vendor/bin/typo3 upgrade:run frontendTemplatesExtensionFieldPrefix
The wizard migrates values in pages, sys_file_metadata and tt_content, including
Content Block collection counters and the Feature link relation's fieldname.
All collections continue to use tt_content; no collection tables are renamed.
Standard fields such as header, bodytext and image, and the CType values stay unchanged.
The wizard preserves old columns and refuses to overwrite conflicting non-default
destination values. Resolve reported conflicts and run it again. Remove obsolete
columns only after verifying the migrated contents. Update custom templates and
integrations that reference the old prefix, clear caches and rebuild the reference index.
Quality
All quality checks are defined in composer.json and run in the shared CI GitHub Actions
workflow (.github/workflows/ci.yml), which calls the shared extension CI of psbits/qa and runs
the test matrix on the supported core and PHP versions in addition to the checks below.
Configuration is centralized in Build/Quality/.
# Read-only verification (all linters) composer lint:all # Auto-fix formatting issues composer fix:all # Individual checks composer analyze:php composer audit:composer composer lint:classes composer lint:htmlxml composer lint:js composer lint:php composer lint:scss composer lint:typoscript composer lint:yaml composer validate:composer
A pre-commit hook (from the psbits/qa package) is installed automatically via .Build/bin/qa sync in
composer post-install-cmd and runs composer lint:all.
The workflow publishes the extension to TER when a release tag is pushed. Publishing requires the
TYPO3_API_TOKEN repository secret.
License
GPL-3.0-or-later. See LICENSE.txt.