Bootstrap Package

Extension key

bootstrap_package

Package name

bk2k/bootstrap-package

Version

15.0

Language

en

Author

Benjamin Kott & Contributors

License

This document is published under the Open Publication License.

Rendered

Wed, 20 Aug 2025 11:52:39 +0000


Bootstrap Package delivers a fully configured frontend theme for TYPO3, based on the Bootstrap CSS Framework.

The goal of this package is also to give an advanced example of how modern templating in TYPO3 CMS can be handled nicely without depending on third party extensions. Bootstrap Package comes with a fully configurable Frontend via TypoScript. This includes the TypoScript Constant Editor.


Table of Contents:

Introduction

Bootstrap Package is a theme for TYPO3 CMS based on the Bootstrap CSS Framework Version 5.1.

Features

  • Full configured TypoScript Setup provided as Static Template
  • Completely adjustable via TypoScript Constants
  • TYPO3 CMS rendering is adjusted to the needs of Bootstrap CSS Framework:

    • Layouts for all Content Elements
    • Section Frames
  • Bootstrap specific Content Elements

    • Accordion
    • External Media
    • Carousel
    • List Group
    • Tab
    • Text and Icon
  • Individual Page Layouts
  • Built-in Less Parser

    • All Variables are configurable via Constant Editor
    • Less support in page.includeCSS property
  • Backend Layouts via PageTsConfig

Screenshots

Desktop

Desktop View

Tablet

Tablet View

Mobile

Mobile View

Installation

The latest version can be installed via TER or via composer by running

composer require bk2k/bootstrap-package
Copied!

in a TYPO3 v10.4+ installation.

Quick Start

Follow these steps to get your Bootstrap package up and running quickly.

Table of Contents:

Disable default content rendering extensions

You do not need to have either Fluid Styled Content or CSS Styled Content installed, we have currently marked both extensions as conflicting to avoid misconfiguration.

If you really know what you are doing, it is safe to use Core content rendering along with Bootstrap Package. But please note that we are adding more content elements that are not supported by these system extensions.

Make sure you have a root page

Create a new page or edit an existing one and set this as root page. You can find this option in the Edit Page mode filed under Behavior > Miscellaneous.

Create a new template on the root page

General

  • Template Title: You can name this as you like, for example "Bootstrap Package".
  • Website Title: This will be your website title visible in the frontend.

Options

  • Clear constants and setup by checking the boxes.
  • Clear the predefined TypoScript setup from the text box if any.
  • Use this template as root-level template by checking the box.

Includes

Include static (from extensions)

  • Bootstrap Package (required)

Static Template Files from TYPO3 Extensions

  • Include before all static templates if root flag is set

Extension Configuration

Use the Extension Manager to adjust the Bootstrap Package to your needs.

PageTsConfig

The Bootstrap Package has a lot of PageTsConfig defaults. In some cases it can be useful to deactivate some of them if you do not need them.

Image Rendering

Bootstrap Package comes with a very flexible responsive image rendering and supports multiple variants for various device sizes. Each variant defines the break point, width and the optional sizes for high resolution image support.

Table of Contents:

Image Variants

Image variants are used to represent the breakpoints of the design. These variants have to be defined according the definitions in the style sheet. Bootstrap Package defines these variants by default:

lib.contentElement.settings.responsiveimages.variants {
    default {
        breakpoint = 1200
        width = 1100
    }
    large {
        breakpoint = 992
        width = 920
    }
    medium {
        breakpoint = 768
        width = 680
    }
    small {
        breakpoint = 576
        width = 500
    }
    extrasmall {
        breakpoint = unset
        width = 374
    }
}
Copied!

The breakpoint defines the minimal device width where the width gets applied. Having a device with a width of 1200 pixels or more uses an image width of 1100 pixels, devices of 992 up to 1199 pixels width use an image width of 920 pixels and so on.

For each of these variants the multiplier of size 1x is set to 1, see next section for more about the high-resolution image support:

  • default

    • breakpoint
    • width
    • sizes

      • 1x

        • multiplier: 1

Example of changing the default configuration for the default variant.

lib.contentElement.settings.responsiveimages.variants {
    default {
        breakpoint = 1200
        width = 1100
    }
Copied!

High Resolution Images

There is a key called sizes in every variant that should be rendered. This dataset consists of several entries, each with a default key for a normal rendering (1x). This key will be added automatically, and it is always available. It is not possible to store sizes smaller than 1. Each size contains a multiplier, which is multiplied by the base size.

Example calculations:

Base width: 1000px

  • Minimum Device Pixel Ratio = 1

    • Multiplier = 1
    • Result: 1000px
  • Minimum Device Pixel Ratio = 1.5

    • Multiplier = 1.25
    • Result: 1250px
  • Minimum Device Pixel Ratio = 2

    • Multiplier = 1.5
    • Result: 1500px

Example configuration to enable high-resolution support for the default variant for devices with a minimum device pixel ratio from 1.5 and 2.

lib.contentElement.settings.responsiveimages.variants {
    default {
        sizes {
            1\.5x {
                multiplier = 1.5
            }
            2x {
                multiplier = 2
            }
        }
    }
}
Copied!

The data for image rendering is now extended with a sub-set for high-resolution variants. If you did not overwrite the default templates, it will just work as soon as you add the configuration. If you have overwritten the default templates, it will still work as before, but you need to add the new support for high-resolution images yourself.

Please check the new updated templates and adjust your code if you want this support.

Configuration by Variant

For each variant the following configuration options are possible:

  • breakpoint
  • width
  • aspectRatio
  • sizes

Configuration by Backend Layout

For each backend layout the following configuration options are possible for each defined column and variant:

  • multiplier
  • gutters
  • corrections

Example configuration for backend layouts.

lib.contentElement.settings.responsiveimages.backendlayout {
    my_layout {                # this is the BE layout
        0 {                    # this is the column to be modified
            multiplier {
                default = 0.75
                large = 0.75
            }
            gutters {
                default = 40
                large = 40
            }
            corrections {
                default = 25
                large = 25
            }
        }
    }
}
Copied!

Configuration by Content Element

For each content element the following configuration options are possible for each defined variant or specific property:

  • multiplier
  • gutters
  • corrections

Example configuration for content elements.

lib.contentElement.settings.responsiveimages.contentelements {
    my_content_element {       # this is the content element
        my_custom_property {   # this is a content element specific property, depends on the implementation and is optional
            multiplier {
                default = 0.5
                large = 0.5
                medium = 0.5
            }
            gutters {
                default = 24
                large = 24
                medium = 24
            }
            corrections {
                default = 25
                large = 25
                medium = 25
                small = 50
                extrasmall = 50
            }
        }
    }
}
Copied!

Configuration options explained

Options for variants:

Property Data Type Description
breakpoint integer Defines the minimal width in pixels of the device
width integer Defines the effective width in pixels for images for this variant
aspectRatio float Optional, defines the default aspect ratio which will override all previously defined ratios on image level
sizes array Optional, defines the available high resolution image multiplier for a minimal device pixel ratio per variant

Options for backend layouts and content elements:

Property Data Type Description
multiplier integer The width is multiplied with this value
gutters integer This value is added to the width before applying the multiplier and substracted afterwards
corrections integer This value is added as last step to the width after all other calculations

The options gutters and corrections are needed if you want to be pixel perfect. Means if you have a 1 pixel outline for example and want this to be subtracted from the width you can do this kind of corrections late in the calculation process.

  • Example Accordion: Here a correction is added to remove the inner padding of the container.
  • Example Card Group: The border is substracted here.

Crop Variants

The Bootstrap Package predefines some cropping variants which can easily be changed or extended by your sitepackage.

The following crop variants are defined by default:

  • 16:9, for a fixed ratio
  • 4:3, for a fixed ratio
  • 1:1, for a fixed ratio
  • NaN, for a free ration

TypoScript

Bootstrap Package was built to be as adjustable as possible, so nothing is fixed and everything can be overridden with TypoScript constants. The constants are grouped in basic and advanced settings. Use the Constant Editor in the backend to modify the values.

Table of Contents:

Bootstrap Package: Basic Constants

The basic settings will provide easy to use and understandable options for that are used mainly for styling and appearance.

page.meta

Property Data Type
description string  
author string  
keywords string  

page.theme

Property Data Type
navigation.style options default | inverse
navigation.type options 0 | top | bottom
breadcrumb boolean 1 | 0
breadcrumbEnableLevel integer+ 2

page.theme.news

Property Data Type
list.header_position options left | center | right
list.header_layout options 1 | 2 | 3 | 4 | 5
list.imageorient options 0 | 1 | 2 | 8 | 9 | 10 | 17 | 18 | 25 | 26
list.imagecols options 1 | 2 | 3 | 4 | 5 | 6
list.maxW integer 1140
list.maxWInText integer+  
pagination.itemsperpage integer 5

page.theme.language

Property Data Type
enable boolean 1 | 0
languageValue string auto | 0,1,2

Bootstrap Package: Advanced Constants

The advanced settings should be used only if you really know what you are doing.

page.fluidtemplate

Property Data Type
layoutRootPath string EXT:bootstrap_package/Resources/Private/Layouts/Page/
partialRootPath string EXT:bootstrap_package/Resources/Private/Partials/Page/
templateRootPath string EXT:bootstrap_package/Resources/Private/Templates/Page/

page.includePath

Property Data Type
css string EXT:bootstrap_package/Resources/Public/Css/
icons string EXT:bootstrap_package/Resources/Public/Icons/
javascript string EXT:bootstrap_package/Resources/Public/JavaScript/

page.meta

Property Data Type
viewport string width=device-width, initial-scale=1
robots string index,follow
mobile-web-app-capable string no
compatible string IE=edge,chrome=1
google string notranslate

page.tracking.google

Property Data Type
trackingID string  
anonymizeIp boolean 1 | 0

config

Property Data Type
no_cache boolean 1 | 0
removeDefaultJS options 0 | 1 | external
compressJs boolean 1 | 0
compressCss boolean 1 | 0
concatenateJs boolean 1 | 0
concatenateCss boolean 1 | 0
admPanel boolean 1 | 0
headerComment string Based on the TYPO3 Bootstrap Package by Benjamin Kott - http://www.bk2k.info

plugin.bootstrap_package.settings

Property Data Type
overrideParserVariables boolean 1 | 0
cssSourceMapping boolean 1 | 0

plugin.bootstrap_package_contentelements.view

Property Data Type
layoutRootPath string EXT:bootstrap_package/Resources/Private/Layouts/ContentElements/
partialRootPath string EXT:bootstrap_package/Resources/Private/Partials/ContentElements/
templateRootPath string EXT:bootstrap_package/Resources/Private/Templates/ContentElements/

Upgrade from 6.2.13 to 6.2.14

This document will only cover breaking changes, that could happen while overriding the Bootstrap Package.

Table of Contents:

Backend Layout Keys

Backend Layout configurations via PageTS have native support in TYPO3 Versions >= 7.4. To make it more easy to upgrade new installations the prefix has been changed in the Bootstrap Package to match the new default that´s available in TYPO3 7.4 and newer versions.

The Prefix for Backend Layouts has been changed from "bootstrap_package" to "pagets". If you have been referring to these values before you need to adapt the new prefix for your own layouts in your TypoScript Configuration.

Please adapt to the new prefix and use the UpdateScript inside the Bootstrap Package extension from the extension manager. This will update all pages in the database and change the prefix from "bootstrap_package" to "pagets".

Note: The update script checks if an update is needed. If there is nothing to do the icon for the Update script will not be shown.

The new Provider in the TYPO3 Core is a port from the Bootstrap Package. That means that there is no need to do any further changes. The configuration stays exactly the same.

Before

Markup

page = PAGE
page {
	10 = FLUIDTEMPLATE
	10 {
		templateName = TEXT
		templateName.stdWrap.cObject = CASE
		templateName.stdWrap.cObject {
			...

			bootstrap_package__default_clean = TEXT
			bootstrap_package__default_clean.value = DefaultClean

			...
		}
	}
}
Copied!

After

Markup

page = PAGE
page {
	10 = FLUIDTEMPLATE
	10 {
		templateName = TEXT
		templateName.stdWrap.cObject = CASE
		templateName.stdWrap.cObject {
			...

			pagets__default_clean = TEXT
			pagets__default_clean.value = DefaultClean

			...
		}
	}
}
Copied!

Upgrade from 6.2.10 to 6.2.11

This document will only cover breaking changes, that could happen while overriding the Bootstrap Package.

Table of Contents:

Support multilevel tree in subnavigation

Frontend output of the submenu has changed and the 3rd level is now displayed by default. You will need to adapt this change if you are not using the theme that comes with the Bootstrap Package.

Before

Markup

<div class="hidden-print hidden-xs hidden-sm" role="complementary">
    <nav class="list-group">
        <a class="list-group-item active" href="#">Link 1</a>
        <a class="list-group-item active" href="#">Link 2</a>
    </nav>
</div>
Copied!

After

Markup

<nav class="hidden-print hidden-xs hidden-sm" role="complementary">
    <ul class="nav nav-sidebar">
        <li><a href="#">Link 1</a></li>
        <li class="active">
            <a href="#">Link 2</a>
            <ul>
                <li class="active"><a href="#">Link 2.1">Link 2.1</a></li>
                <li><a href="#">Link 2.2">Link 2.2</a></li>
            </ul>
        </li>
    </ul>
</nav>
Copied!

Drop version number for jQuery in filename

Previously we appended the version number to the jQuery filename, this has lead to missing jQuery versions if files were moved outside the bootstrap_package. We are not removing the version number to prevent jQuery is missing, this makes it also more easy to maintain in the build process. Check your TypoScript setup for possible overrides.

Before

TypoScript Setup

page.includeJSFooterLibs {
    jquery = {$page.includePath.javascript}Libs/jquery-x.xx.xx.min.js
}
Copied!

After

TypoScript Setup

page.includeJSFooterLibs {
    jquery = {$page.includePath.javascript}Libs/jquery.min.js
}
Copied!

Use default Bootstrap markup for navigation toggle

In previous builds Glyphicon icons were used to represent the toggle state of the main menu for smaller screen sizes. Also the toggle js was always loaded in within the main.js javascript file from the Bootstrap Package. This has lead to problems when the icon font was changed or the main javascript file was externally overriden.

Instead of adapting the custom markup to your theme the default bootstrap markup is now in use, so its working now also out of the box also if the custom theme from the Bootstrap Package is not included. The toggle state is now solved via a CSS class toggle and a bit of custom css in the Bootstrap Package theme. The JavaScript toggle functionality has been move into a single file so it can be easily turned of if you do not need it.

Before

Markup

<button class="navbar-toggle navbar-toggle-menu" type="button" data-toggle="collapse" data-target=".navbar-collapse">
    <span class="glyphicon glyphicon-list"></span>
    <span class="sr-only">Toggle navigation</span>
</button>
Copied!

After

Markup

<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".navbar-collapse">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
</button>
Copied!

TypoScript Setup

page.includeJSFooterlibs {
    #### Toggle collapsed CSS class on the navbar toggle button
    bootstrap_navbartoggle = {$page.includePath.javascript}Libs/bootstrap.navbartoggle.min.js
}
Copied!

Custom Lightbox JavaScript has been moved

In order to make the package more modular we removed the main.js file in favor of single files for each functionality so it can be added or removed more easily.

After

TypoScript Setup

page.includeJSFooterlibs {
    #### Basic lightbox implementation for bootstrap
    bootstrap_lightbox = {$page.includePath.javascript}Libs/bootstrap.lightbox.min.js
}
Copied!

LESS files have been moved private to public

The resources folder in TYPO3 extensions is protected by default that made it impossible to make real usage of CSS SourceMaps. The files have been moved to Resources/Public, please ensure that your update your references to these files.

Before

EXT:bootstrap_package/Resources/Private/Less/
Copied!

After

EXT:bootstrap_package/Resources/Public/Less/
Copied!

Corrected calculation of relative paths in build in LESS parser

Calculation of relative paths in less should now be resolved correctly. The wired relative paths you have to set before will no longer be working and you need to set the constants now relative from the LESS file that is parsed.

Before

TypoScript Constants

plugin.bootstrap_package {
    settings.less {
        icon-font-path = "../../../../../typo3conf/ext/bootstrap_package/Resources/Public/Fonts/"
    }
}
Copied!

After

TypoScript Constants

plugin.bootstrap_package {
    settings.less {
        icon-font-path = "../../Fonts/"
    }
}
Copied!

Template Fallbacks

We enabled fallbacks for page templates, so you can extend the package without the need to copy all the templates if you want to change parts of the templates.

Before

TypoScript Setup

page.10 {
    file.stdWrap.cObject = CASE
    file.stdWrap.cObject {

        key.data = levelfield:-1, backend_layout_next_level, slide
        key.override.field = backend_layout

        bootstrap_package__default_clean = TEXT
        bootstrap_package__default_clean.value = {$page.fluidtemplate.templateRootPath}DefaultClean.html
        bootstrap_package__default_clean.insertData = 1

        ...

    }
    partialRootPath = {$page.fluidtemplate.partialRootPath}
    layoutRootPath = {$page.fluidtemplate.layoutRootPath}
}
Copied!

After

TypoScript Setup

page.10 {
    templateName = TEXT
    templateName.stdWrap.cObject = CASE
    templateName.stdWrap.cObject {

        key.data = levelfield:-1, backend_layout_next_level, slide
        key.override.field = backend_layout

        bootstrap_package__default_clean = TEXT
        bootstrap_package__default_clean.value = DefaultClean

        ...

    }
    templateRootPaths {
        0 = EXT:bootstrap_package/Resources/Private/Templates/Page/
        1 = {$page.fluidtemplate.templateRootPath}
    }
    partialRootPaths {
        0 = EXT:bootstrap_package/Resources/Private/Partials/Page/
        1 = {$page.fluidtemplate.partialRootPath}
    }
    layoutRootPaths {
        0 = EXT:bootstrap_package/Resources/Private/Layouts/Page/
        1 = {$page.fluidtemplate.layoutRootPath}
    }
}
Copied!

Deprecated fallbacks

Fallbacks for deprecated backendlayout keys have been removed, use the alternatives instead.

Removed Templates

bootstrap_package__default_subnavigation
bootstrap_package__default_subnavigation_2_columns
Copied!

Alternatives Templates

bootstrap_package__default_subnavigation_right
bootstrap_package__default_subnavigation_right_2_columns
Copied!

Support for EXT:THEMES removed

Through lack of resources we removed the support for ext:themes. It is not planned to support ext:themes in the future again.

Contribution

Feel free to create an issue or fork this project and create a pull request when you're happy with your changes.

Table of Contents:

Bug reporting

Please open an issue at GitHub and describe your problem.

Clean code

We check the source code according to the our Coding Guidelines. To reformat the code automatically, you can use PHP CS Fixer as follows:

composer cgl
Copied!

Local environment

The extension comes with a ready to use DDEV Local configuration. Type ddev start in the extension root folder to start the Docker container.

ddev launch will open the browser and head to the testing website. You can use ddev launch typo3 to get directly to the backend.

Build the frontend files

When you change any of the SCSS files, the combined and minified versions of the CSS have to be rebuild.

You can run them like this:

cd Build
npm ci
npm run build
Copied!

Then commit any changes to files in folder Resources/Public/Css. If you ommit any of these steps the pipeline of the automatic checks fails for "build-frontend".

License

This project is released under the terms of the MIT license.

Slack

You can connect directly with us on Slack, the preferred instant communication platform of TYPO3 CMS developers. If you already have access to the TYPO3 Slack platform join the #bootstrap-package channel. If you don't have access yet, you can register at my.typo3.org.

X =

If you have any questions about this project or just want to talk: Send a tweet @benjaminkott.

Sitemap

Index