Typoscript USER / USER_INT objects in powermail in

2019-09-07 07:32发布

问题:

I've a custom extension to render a value from database. I want to prefill the returned value of the extension using powermail prefill typoscript.

But when I add the plugin as userfunction, then it will display strange output in frontend.

See my typoscript code below;

lib.companyname = USER_INT
lib.companyname {
        userFunc = tx_extbase_core_bootstrap->run     
        extensionName = ExtPowermail
        pluginName = Extpowermail
        vendorName = TYPO3
        controller = Extpowermail 
        action = list  
    } 

plugin.tx_powermail.settings.setup {
  prefill {
    company < lib.companyname
  }
}

Here "company" is an input type text field in powermail. In frontend the output of the above code render like this;

<!--INT_SCRIPT.ad09b2f270243798e007be81eba0871c-->

I've changed USER_INT to USER and there is no change in the output. If anybody knows the solution, please help.

回答1:

I'm just starting out with Typo3 myself, but I needed that functionality also. I had the same problem, it started working for me when I used this:

plugin.tx_powermail.settings.setup.prefill {
   company = USER
   company {
       userFunc = tx_extbase_core_bootstrap->run     
       extensionName = ExtPowermail
       pluginName = Extpowermail
       vendorName = TYPO3
       switchableControllerActions.Extpowermail.1 = list
       }
  }

The output you are getting is some reference to the cache, as far as I know. When using switchableControllerActions it seems to stop caching the content, so you get the regular output.