How to define and bring path to afx-renderer?

Hi,

i’m trying something like this:

But the output looks like
grafik

  1. How can i define things/props and use it in AFX?
  2. Where can I find a documentation for such a question? Here I found nothing useful.
  3. How can I find the path, which is working at this point?

Thank you in advance!
KR D.

1 Like

Hi,
for using your prop together with another string it should look like this:

<meta name="..." content={props.faviconPath + 'ms-icon-144x144.png'} />

And if you are using Neos > 7.0 you can use the StaticResource Eel Helper to load the icon from your sitepackage.

example:
<link rel="stylesheet" href={StaticResource.uri('Neos.Demo', 'Public/Styles/Main.css')} media="all" />

In your code, you’d need faviconPath = … inside the headTags component:

headTags = Neos.Fusion.Component {
  favIconPath = '…'
  renderer = afx`
    {props.faviconPath}
  `
}

Anything on the same level as the renderer is passed into the renderer as props.…

To pass the faviconPath down from the AbstractPage prototype, you could make it available in the context by @context.favIconPath in the AbstractPage and then either

headTags = Neos.Fusion.Component {
  favIconPath = ${favIconPath} 
  renderer = afx`
    {props.faviconPath}
  `
}

(see https://fusionpen.punkt.de/fusionpen/ce2dca022e12f8464436c42c7a4e48b68246ece5.html) or

headTags = Neos.Fusion.Component {
  renderer = afx`
    {faviconPath}
  `
}

(see https://fusionpen.punkt.de/fusionpen/91bec74e83d8090fb9376e4095f4dab0e66d55d6.html)