Bug #89013
closedSVG inline-Rendering fails due to missing src solving
0%
Description
I need to extract an svg image from the page properties and render it as an inline-SVG to be able to adjust styles afterwards.
For this, I use the typoscript dataProcessor like this:
page.10.dataProcessing {
20 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
20 {
entryLevel = 1
levels = 1
expandAll = 1
includeSpacer = 0
as = menuCustomersArea
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = media
as = icon
if {
isTrue = {$page.theme.menuCustomersArea.icon.enable}
}
}
}
}
}
Next in my Fluid template I try to integrate the icons by
<f:cObject typoscriptObjectPath="lib.pageIcon"/>
Now, the lib.pageIcon looks like this:
lib.pageIcon = SVG
lib.pageIcon {
renderMode = inline
src = {item.icon.0}
width = 100
height = 100
}
,
but the rendering doesn't work. If I use {item.icon.0} in <f:image image="{item.icon.0} it is working correctly. If I use <f:debug>{item}</item> I see the correct path under
fileadmin{item.icon.0.originalFile.identifier}.
I don't know what to do to resolve the path correctly and thought maybe this is a bug. If not, excuse me for interupting you.
Regards,
Thorsten
Updated by Georg Ringer over 4 years ago
- Status changed from New to Resolved
this works fine with following code>
lib.pageIcon = SVG lib.pageIcon { renderMode = inline src.current = 1 width = 100 height = 100 }
<f:cObject typoscriptObjectPath="lib.pageIcon">{menu.0.icon.0.originalFile.publicUrl}</f:cObject>
tested on current master but should work on 9.5 as well.
I am closing the issue, if you are unsure, just ping me on slack