Bug #91935
closedRelative pathes in inline CSS not adapted (page.includeCSS.<file>.inline=1)
100%
Description
Usually relative pathes to fonts and images in CSS files are being adapted by Typo3 when needed. This is usually necessary when compression and concatenation is applied and final CSS files are generated in a subdirectory of typo3temp
.
Unfortunately, when using the TypoScript Setup option page.includeCSS.<fileID>.inline = 1
the relative pathes are NOT replaced.
Let's assume an extension user_package
with a CSS file and a font file in subdirectories of typo3conf/ext/user_package/Resources/Public/Layout/...
typo3conf/ext/user_package/Resources/Public/Layout/css/inline-styles.css
typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot
The font file will be referenced within inline-styles.css like this:
src: url(../fonts/localFontFile.eot)
When using regular Typo3 concatenation and compression, the final CSS file is located in /typo3temp/assets/compressed/
and the font path will be translated to
src: url(../../../typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot)
This path translation is performed in \TYPO3\CMS\Core\Resource\ResourceCompressor::findAndReplaceUrlPathsByRegex()
and works fine.
When using the TypoScript Setup option page.includeCSS.<fileID>.inline = 1
the relative pathes should be replaced as well, to avoid invalid references. Final path translation should be absolute to document root, e. g.:
src: url(/typo3conf/ext/user_package/Resources/Public/Layout/fonts/localFontFile.eot)
Updated by Gerrit Code Review over 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65395
Updated by Gerrit Code Review over 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65395
Updated by Gerrit Code Review over 4 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65395
Updated by Gerrit Code Review about 4 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65395
Updated by Gerrit Code Review about 4 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65395
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65720
Updated by Alexander Künzl about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6945d8f2fb7ed437f64bbb35c83425f5d793f9ac.