Project

General

Profile

Actions

Feature #99510

closed

ScriptViewHelper and CssViewHelper miss file to inline rendering option

Added by Tanel Põld almost 2 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Start date:
2023-01-10
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
inline, css, javascript, f:asset
Complexity:
Sprint Focus:

Description

f:asset.css and f:asset.script are great but miss an option to render inline from files.
This would help keeping JavaScript and CSS out of XML files in case one desires rendering it inline.

So for example this CSS file would be loaded inline:

<f:asset.css identifier="extensionName" inline href="EXT:extensionname/Resources/Public/Css/extensionname.css" />

Probably not so simple but...
Registering the 'inline' attribute and then adding a condition something like this in:
typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php

if ($file !== null) {
    if ($inline) {
        $content = (string)file_get_contents(GeneralUtility::getFileAbsFileName(trim($file)));
        $this->assetCollector->addInlineStyleSheet($identifier, $content, $attributes, $options);
    } else {
        $this->assetCollector->addStyleSheet($identifier, $file, $attributes, $options);
    }
}
Actions #1

Updated by Tanel Põld over 1 year ago

Semantically 'embed' or 'internal' instead of 'inline' would be more correct...

Actions #2

Updated by Benni Mack over 1 year ago

  • Target version changed from 12 LTS to Candidate for Major Version
Actions #3

Updated by Riccardo De Contardi 7 months ago

  • Category set to Fluid
Actions #4

Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #5

Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #6

Updated by Gerrit Code Review 6 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #7

Updated by Gerrit Code Review 6 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #8

Updated by Gerrit Code Review 6 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #9

Updated by Gerrit Code Review 4 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #10

Updated by Gerrit Code Review 4 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #11

Updated by Gerrit Code Review 3 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #12

Updated by Gerrit Code Review 2 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #13

Updated by Gerrit Code Review 2 months ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #14

Updated by Gerrit Code Review 2 months ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #15

Updated by Gerrit Code Review 2 months ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #16

Updated by Gerrit Code Review 2 months ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #17

Updated by Gerrit Code Review 2 months ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #18

Updated by Gerrit Code Review 2 months ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #19

Updated by Gerrit Code Review 2 months ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #20

Updated by Gerrit Code Review 2 months ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #21

Updated by Gerrit Code Review 2 months ago

Patch set 18 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #22

Updated by Gerrit Code Review 2 months ago

Patch set 19 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84424

Actions #23

Updated by André Buchmann 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #24

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF