halliballi
halliballi

Reputation: 130

How can I pass one parameter or value from fluid to typoscript

I want to pass a value from my fluid code to typoscript. I have two variable (one is int, the other is some text) and I want to use those values in typoscript. Is that possible and if it is possible how?

I want to use the values to create opengraph tags in head of HTML.

Here's my TypoScript

lib.getuserItems = TEXT
lib.getuserItems.wrap = |

page.meta {
      og:description < lib.getuserItems
      og:description.attribute = property
      og:locale = de_DE
      og:locale.attribute = property
}

and here's my Fluid

<f:cObject typoscriptObjectPath="lib.getuserItems" data="{article.description}" />

Upvotes: 1

Views: 1031

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10800

Your problem will not be the parameter transfer.

If you use <f:cObject> in fluid you can compute something with typoscript which is returned and can be used to render the fluid template.

You want some data from your fluid-template transferred to the page configuration (page.meta....) which is not possible in this way.

If you want to set those meta tag data you can use viewhelper in fluid, but that must be PHP viewhelper, that can access page configuration and set these data.

Be aware that TYPO3 9LTS has introduced an API for metatags

Upvotes: 3

Related Questions