douxiong3245 2017-01-19 08:47
浏览 55

TYPO3 Powermail:如何将自定义字段添加到导出?

Powermail: 2.25.2
TYPO3: 6.2.19

I added a dynamic custom field to Powermail within a new extension and want to have the value included in the csv export. If I use the Powermail Module and expand the export block, there is a possibility to add additional fields to the export. Unfortunately, my custom field is not listed there.

What can I do?

  • 写回答

2条回答 默认 最新

  • duadpnld426905 2017-01-19 08:47
    关注

    From checking the template Resources/Private/Partials/Module/Export.html I had the idea, to add it to the template, but wasn't sure which ID.

    After some debugging through the extension I realized, that my custom field can easy be added to the ul.extended_export_field by the mentioned template, because it was already in the {page.fields} array. The condition for {field.advancedFieldType} prevented rendering the custom field, because it's type isn't in the advanced and basic fields.

    You have therefore 2 solutions to fix that:

    1. change Classes/Domain/Model/Field.php within your extension
      and extend the $advancedFieldTypes or $basicFieldTypes array

    2. change the template Resources/Private/Partials/Module/Export.html
      by adding a condition for your custom field type and render it into the list like <li id="{field.uid}">{field.title} <span class="info">(<f:translate key="FormField" />)</span></li>

    What I still not know is how to manipulate the output within the export.

    Update:

    Output can be modified within
    Resources/Private/Templates/Module/ExportCsv.html

    评论
  • drzfnr0275 2018-07-02 01:18
    关注

    In at least powermail 4.4.0 you can configure the exportability of custom fields with TypoScript:

    tx_powermail.flexForm.type.addFieldOptions.myfield.export = 1
    

    This is described in the manual https://docs.typo3.org/typo3cms/extensions/powermail/ForDevelopers/AddNewFields/Index.html

    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部