Issue Bug Closed

#107100page.cssInline has to be cached

David Bruchmann 07/15/25, 11:58 updated 11/16/26, 21:27

Description

Having the following code I get the desired result:

    page.headerData {
        10 = USER_INT
        10 {
            stdWrap {
                wrap = .header{background: url('|') 0 0 no-repeat}
                outerWrap = <style>|</style>
            }
            userFunc = Vendor\Extension\Service\ImageService->getRandomFilePath
            userFunc {
                directory = 1:/banners
            }
        }
    }
Using the same code with
    page.cssInline { ... }
(without the outerWrap)
is not possible as the markers like
<!--INT_SCRIPT.d6aeb8678ee6f63117e8806ed1ae368f-->
are not replaced.

My expectation is that page.cssInline should be able to return the results of USER_INT like page.headerData does.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Oliver Bartsch commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-16T21:27:17+00:00" > 11/16/26, 21:27 </span>

    Hey,

    thanks for the detailed report.

    This is caused by config.inlineStyle2TempFile, which is enabled by default. With that setting, the result of page.cssInline is not printed into the HTML. It is written to a static CSS file in typo3temp/assets/css/ and linked from the page. The <!--INT_SCRIPT...--> placeholder of your USER_INT therefore ends up inside that file. TYPO3 only replaces these placeholders in the HTML document, never in files that the web server delivers directly. page.headerData works because its content is always part of the HTML.

    To get uncached content in cssInline, disable the temp file:

    config.inlineStyle2TempFile = 0

    The CSS is then rendered as an inline <style> block in the page, and the USER_INT placeholder is replaced the same way as in headerData. Your current headerData setup is also fine, and probably the clearer choice for a per-request background image.

    A static file cannot contain per-request content, so this works as designed, and I’ll close the issue. If you think the core should switch to inline output automatically when uncached content is detected, please open a feature request.

    Cheers, Oli