0
votes

I have a Fluid template with this line of code:

<f:cObject typoscriptObjectPath="lib.psStadtDetail" data="{stadt}" />

And this bit of Typoscript to call a plugin:

lib.psStadtDetail = USER_INT
lib.psStadtDetail {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    pluginName = Pferdeservice
    extensionName = Pferdeservice
    vendorName = Pferdeservice
    Controller = User
    action = search

    switchableControllerActions.User.1 = list

    features    < plugin.tx_pferdeservice.features
    view        < plugin.tx_pferdeservice.view
    persistence < plugin.tx_pferdeservice.persistence
    settings {
            StaticZip < temp.psStadtZip
            #StaticZip = 70173
    }
}

Now, the settings for this plugin, specifically StaticZip should come from the Fluid template. But the data is not being transferred by temp.psStadtZip

temp.psStadtZip = COA
temp.psStadtZip {
  10 = TEXT
  10.value.current = 1
  20 = TEXT
  20.value.dataWrap = {field:plz}
}

When I output temp.psStadtZip only, I get the correct zip code.

Why can't I use this for the plugin settings? How do I accomplish this?

1
Did you try to use lib.psStadtZip instead? I guess temp. objects got some special behavior about their runtime etc. - Paul Beck
@PaulBeck Yes, tried multiple things. I just found out that the output is blank {field:plz}, so not the actual zipcode. - Andreas
20.value.dataWrap = {field:plz} is not valid at all I see now. Use 20.field = plz instead - Paul Beck
@PaulBeck Anything I try always return the exact same text, i.e. {field:plz}, not the actual value. Seems, as the settings parameter does not handles the input it gets but just displays the text it gets. - Andreas

1 Answers

0
votes

The property settings can only be used for an array of keys.

10 = FLUIDTEMPLATE
10 {
  file = fileadmin/templates/MyTemplate.html
  settings {
      name = Car
      color = red
  }
}

See TYPO3 TypoScript Reference (latest (8-dev)): Content Objects (cObject) > Fluidtemplate > settings

Instead you should use variables which is an array of cObjects.

lib.psStadtDetail {
    # Replace settings with variables
    variables {
        StaticZip < temp.psStadtZip
        #StaticZip = 70173
    }
}

See TYPO3 TypoScript Reference (latest (8-dev)): Content Objects (cObject) > Fluidtemplate > variables