Project

General

Profile

Actions

Bug #89013

closed

SVG inline-Rendering fails due to missing src solving

Added by Thorsten Griebenow about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-08-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
SVG, Fluid
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

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

Actions #2

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF