Typo3 Powermail:从数据库中的条目创建字段
我的问题是: 我需要Powermail中的字段矩阵:Typo3 Powermail:从数据库中的条目创建字段,typo3,typo3-8.x,powermail,Typo3,Typo3 8.x,Powermail,我的问题是: 我需要Powermail中的字段矩阵: product_1 - price_1 - number_1 product_2 - price_2 - number_2 product_3 - price_3 - number_3 等等。手动创建此字段没有问题,但我需要从数据库派生它。行数取决于数据库中的条目数 是否有可能“动态”创建字段,可能是通过打字脚本或userfunc 谢谢 您可以使用powermail的TypoScript字段从TypoScript生成代码 您也可以使用自己的
product_1 - price_1 - number_1
product_2 - price_2 - number_2
product_3 - price_3 - number_3
等等。手动创建此字段没有问题,但我需要从数据库派生它。行数取决于数据库中的条目数
是否有可能“动态”创建字段,可能是通过打字脚本或userfunc
谢谢 您可以使用powermail的
TypoScript
字段从TypoScript生成代码
您也可以使用自己的字段类型,如第TSConfig页所述:
tx_powermail.flexForm.type.addFieldOptions.new = New Field
# The label could also be written with LLL: to localize the label
# Example to grab a value from locallang.xml or locallang.xlf
#tx_powermail.flexForm.type.addFieldOptions.new = LLL:EXT:ext/Resources/Private/Language/locallang.xlf:label
# Tell powermail that the new fieldtype will transmit anything else then a string (0:string, 1:array, 2:date, 3:file)
# Example for dataType array
#tx_powermail.flexForm.type.addFieldOptions.new.dataType = 1
# The new field is not just a "show some text" field. It's a field where the user can send values and powermail stores the values?
# You can tell powermail that this new field should be exportable in backend module and via CommandController
#tx_powermail.flexForm.type.addFieldOptions.new.export = 1
new
是字段标识符。默认情况下,Powermail搜索具有标识符名称的部分,例如New.html
现在,您可以使用ViewHelper获取数据并为字段创建html。我将创建一个新的字段类型,称之为(例如)productsheet。手册中有一个示例说明了如何执行此操作: 这里是新字段的两个示例页面TSConfig行:
#添加新字段
tx_powermail.flexForm.type.addFieldOptions.productsheet=产品字段
tx_powermail.flexForm.type.addFieldOptions.productsheet.dataType=1
就像一个charme。。。谢谢