定制 webcoast/dce-to-contentblocks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webcoast/dce-to-contentblocks

Composer 安装命令:

composer require webcoast/dce-to-contentblocks

包简介

Migration tool to convert DCE elements to content-blocks

README 文档

README

This TYPO3 extension helps you migrate your DCE elements on TYPO3 v13 to TYPO3 CMS Content Blocks, the official TYPO3 extension to define Content Types.

Installation

composer require webcoast/dce-to-contentblocks

Migration

vendor/bin/typo3 dce:migrate

Run this command and select the DCE you would like to migrate and in which extension to save the content block.

Upgrade Wizard

Write custom RecordDataMigrators to migrate existing DCE elements to the newly created content blocks.

#[AutoconfigureTag('webcoast.dce_to_contentblocks.record_data_migrator')]
#[SourceContentType('dce_dceuid...')] // TODO: set source content type
#[SourceContentType('dce_dceuid...')] // One migrator can have multipe source content types
class ...Migrator extends RecordDataMigrator
{
    protected string $targetContentType = '...'; // TODO: set target content type

    public function migrate(array $flexFormData, array $record): array
    {
        // TODO: return associative array for DataHandler
    }
}

Migrate File Reference

$images = [];
foreach($flexFormData['images'] as $image) {
    if ($image instanceof FileReference) {
        $images[] = $this->updateFileReference($image, 'new_image_field');
    } else if ($image instanceof File) {
        $images[] = $this->addFileReference($image, 'tt_content', 'new_image_field', $record['uid'], $record['pid'], $record['sys_language_uid']);
    }
}
return [
    'new_image_field' => implode(',', $images),
];

Migrate Inline Records

$inlineRecords = [];
$sorting = 8;
foreach ($flexFormData['inline_field'] ?? [] as $link) {
    $inlineRecords[] = $this->addReference('new_inline_table', [
        'title' => $link['title'] ?? '', // e.g.
        'foreign_table_parent_uid' => $record['uid'],
        'sorting' => $sorting,
        'sys_language_uid' => $record['sys_language_uid'],
        'pid' => $record['pid'],
    ]);
    $sorting = $sorting * 2;
}
return [
    'new_inline_field' => implode(',', $inlineRecords),
];

统计信息

  • 总下载量: 1.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-03-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固