PHPackages                             b13/assetcollector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. b13/assetcollector

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

b13/assetcollector
==================

Add CSS and SVG files and strings as inline style tag/inline svg to the html code.

4.0.0(1mo ago)10118.4k↓22.1%[4 issues](https://github.com/b13/assetcollector/issues)GPL-2.0-or-laterPHPCI passing

Since Jul 4Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/b13/assetcollector)[ Packagist](https://packagist.org/packages/b13/assetcollector)[ RSS](/packages/b13-assetcollector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (38)Used By (0)

Asset Collector for TYPO3
=========================

[](#asset-collector-for-typo3)

This extension adds ViewHelpers to dynamically add CSS, JS and SVG files and CSS inline strings to be added to the HTML document from within Fluid Templates. In addition, including JS files are added via a registry to be only added once, which can be achieved via TypoScript as well.

The main benefit over TYPO3 Core functionality is that AssetCollector API is a straightforward approach for integrators to not worry about having duplicate assets entries added again, and to only include the assets that are necessary. This way, integrators can build content types or plugins and attach only necessary resources to one content type, even if it was added multiple times by any editor.

Installation &amp; Requirements
-------------------------------

[](#installation--requirements)

Use `composer req b13/assetcollector` or install it via TYPO3's Extension Manager from the [TYPO3 Extension Repository](https://extensions.typo3.org) using the extension key `assetcollector`.

You need TYPO3 v9 or later to use this extension.

JavaScript includes
-------------------

[](#javascript-includes)

This is useful when adding JavaScript files via TypoScript or within a Fluid template based on content element. In contrast to TYPO3 Core, the following functionality is given:

- A JavaScript resource can be added multiple times, but is only added once.
- By having a flexible API, additional attributes such as "async" or "amp" can be added directly.

All JavaScript data is always added within the "head" tag.

If adding via TypoScript, the following syntax applies:

```
page.jsFiles {
    analytics = https://analytics.b13.com/track.js
    analytics.async = 1
    analytics.data-myattribute = true
}

```

CSS inliner
-----------

[](#css-inliner)

This is useful for adding inline-CSS that targets "above the fold" content based on content the editor adds to the page, or to add CSS inline styles that add background images for specific breakpoints (media queries are possible in the html head, not in inline styles using the `style` attribute for specific elements).

### Examples

[](#examples)

In your Fluid templates use the ViewHelper to add CSS files or inline CSS code to the head of any page using this template file:

```

```

This includes the content of `myCssFile.css` inline as a style block in the HTML head of the document.

```
.b_example { color: red; }

```

This adds the string `.b_example { color: red; }` to the inline style block in the HTML head of the document.

Remember to add the Fluid namespace to your Fluid templates (or do this globally, see below):

```

```

CSS file include
----------------

[](#css-file-include)

The include option is useful for including CSS files as externally referenced files based on content of your pages. Depending on the size of the CSS and the number of pages the same CSS is used inlining the CSS into the page might not be the best option. To include a CSS file across all pages of your installation could result in including way too much CSS for some of your content pages.

The ViewHelper for including CSS can be used to include CSS files within your Fluid Templates as external files by adding `external="1"`. This adds the CSS file reference to the `` part of your `` document:

```

```

This will add the following code within the `` of your document:

```

```

You can also specify a value for the `media` argument:

```

```

SVG Map inliner
---------------

[](#svg-map-inliner)

Adds SVG files as inline map using a ViewHelper. A file can be added using a file path or an icon name set in your TypoScript setup.

This only includes the icons needed on a given page as inline SVG symbols in one svg map.

### Examples

[](#examples-1)

#### Using a file path

[](#using-a-file-path)

```

```

This adds the svg inline code to your template output

```

```

and adds the symbol from `myIconFile.svg` to the page's inline SVG map. The file name should be unique and is used to identify the icon within the ``-tag. Multiple uses of the same filename will result in the icon being included only once (correctly so) in the SVG map.

#### Using a name/identifier set in your TypoScript setup

[](#using-a-nameidentifier-set-in-your-typoscript-setup)

```
plugin.tx_assetcollector.icons {
  iconName = EXT:myext/Resources/Public/Svg/myIconFile.svg
}

```

```

```

This will add the svg inline code to your template output using `iconName` as an identifier.

### Notes on automated rendering of the svg map

[](#notes-on-automated-rendering-of-the-svg-map)

The svg file is parsed and all children of the first `` tag are being included in a `` section within the svg map. The id of the symbol will be `icon-` and the `viewBox` from the original `` tag will be added as an attribute to the `` tag. All `` sections will be wrapped:

```

```

Global registering of Fluid Namespace
-------------------------------------

[](#global-registering-of-fluid-namespace)

If you want to register the fluid namespace globally, add this to your site extensions `ext_localconf.php`:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['ac'][] = 'B13\Assetcollector\ViewHelpers';

```

License
-------

[](#license)

The extension is licensed under GPL v2+, same as the TYPO3 Core. For details see the LICENSE file in this repository.

Open Issues
-----------

[](#open-issues)

If you find an issue, feel free to create an issue on GitHub or a pull request.

### Credits

[](#credits)

This extension was created by [David Steeb](https://github.com/davidsteeb) in 2019 for [b13 GmbH](https://b13.com).

[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~96 days

Total

30

Last Release

55d ago

Major Versions

1.6.1 → 2.0.02022-11-29

2.0.2 → v13.x-dev2024-05-24

3.0.6 → 4.0.02026-03-24

PHP version history (3 changes)1.3.0PHP ^7.2

1.5.2PHP ^7.2 || ^8.0

2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/165630?v=4)[Benni Mack](/maintainers/bmack)[@bmack](https://github.com/bmack)

---

Top Contributors

[![davidsteeb](https://avatars.githubusercontent.com/u/3862523?v=4)](https://github.com/davidsteeb "davidsteeb (35 commits)")[![achimfritz](https://avatars.githubusercontent.com/u/2152991?v=4)](https://github.com/achimfritz "achimfritz (33 commits)")[![bmack](https://avatars.githubusercontent.com/u/165630?v=4)](https://github.com/bmack "bmack (18 commits)")[![stegmatze](https://avatars.githubusercontent.com/u/14198734?v=4)](https://github.com/stegmatze "stegmatze (14 commits)")[![jschlier](https://avatars.githubusercontent.com/u/9108576?v=4)](https://github.com/jschlier "jschlier (3 commits)")[![NeoBlack](https://avatars.githubusercontent.com/u/1128085?v=4)](https://github.com/NeoBlack "NeoBlack (2 commits)")[![achimfritz-b13](https://avatars.githubusercontent.com/u/156071319?v=4)](https://github.com/achimfritz-b13 "achimfritz-b13 (2 commits)")[![andreaskienast](https://avatars.githubusercontent.com/u/1787983?v=4)](https://github.com/andreaskienast "andreaskienast (1 commits)")[![magicsunday](https://avatars.githubusercontent.com/u/564393?v=4)](https://github.com/magicsunday "magicsunday (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/b13-assetcollector/health.svg)

```
[![Health](https://phpackages.com/badges/b13-assetcollector/health.svg)](https://phpackages.com/packages/b13-assetcollector)
```

###  Alternatives

[fluidtypo3/flux

The flux package from FluidTYPO3

152982.2k20](/packages/fluidtypo3-flux)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[brotkrueml/schema

Embedding schema.org vocabulary - API and view helpers for schema.org markup

33584.6k13](/packages/brotkrueml-schema)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[mautic/mautic-typo3

Add-on TYPO3 extension that enhances the "EXT:marketing\_automation" TYPO3 extension by connecting it to the Mautic Marketing Automation platform: Determine "Persona" from Mautic segments. Also provides additional services e.g. language synchronisation between Mautic and TYPO3.

236.3k](/packages/mautic-mautic-typo3)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
