douxiong3245 2017-01-19 16: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 16: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

    评论

报告相同问题?