Project

General

Profile

Actions

Feature #102261

closed

Allow <f:be.pageRenderer> to unregister CSS files

Added by Garvin Hicking about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2023-10-26
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Backend Module authors may want to deliver a fully customized
backend without the CSS framework of TYPO3.

Currently the pageRenderer is only able to register
additional CSS files for output, but the access to
the internal $cssFiles property is gated and no
event or get/setter allows to access it.

This patch adds the ability to both retrieve the
current list of $cssFiles and also a removeCssFile()
method.

The ViewHelper is enhanced to allow access to these
methods, because when Extbase actions are executed,
accessing the PageRenderer singleton instance does
not yet have the internal stylesheets assigned.

A modules Fluid template could then do this:

    <f:be.pageRenderer
        includeJavaScriptModules="{
            0: '@typo3/backend/global-event-handler.js',
            1: '@typo3/belog/backend-log.js'
        }" 
        removeCssFiles="{
            0: 'backend.css'
        }" 
    />

The array passed to removeCssFiles can contain
any string to match against the registered files,
so whole paths or specific files can be removed,
no matter if EXT:xxx syntax or a absolute file
(like for backend.css) is used.

(The Fluid viewhelper will also work for Backend modules
outside Extbase context.)

Actions

Also available in: Atom PDF