承接 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),
];

统计信息

  • 总下载量: 771
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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