定制 zoglo/contao-row-wizard 二次开发

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

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

zoglo/contao-row-wizard

最新稳定版本:0.1.0

Composer 安装命令:

composer require zoglo/contao-row-wizard

包简介

RowWizard for Contao Open Source CMS

README 文档

README

Warning

The Row-Wizard is now part of Contao 5.7 and does not need to be installed

Contao Row Wizard

github version amount of downloads minimum php version

Description

See contao/contao#8781 for the Contao feature (This bundle acts as a backport now).

This bundle adds a widget that allows adding multiple rows, with each row containing multiple widgets arranged as columns. The data can be stored as a serialized array in the database.

Installation

Via composer

composer require zoglo/contao-row-wizard

Configuration

use Contao\CoreBundle\DataContainer\PaletteManipulator;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Zoglo\RowWizardBundle\EventListener\ColumnWizardListener;

$GLOBALS['TL_DCA']['tl_content']['fields']['columnWizardOne'] = [
    'label' => ['columnWizardOne', 'And some random description'], // Or a &$GLOBALS['TL_LANG'] pointer
    'inputType' => 'rowWizard',
    'fields' => [
        'type' => [
            'label' => ['Type'], // Or a &$GLOBALS['TL_LANG'] pointer
            'inputType' => 'select',
            'options' => ['foo', 'bar', 'baz', 'quux'],
            'eval' => [
                'includeBlankOption' => true,
                'chosen' => true,
            ],
        ],
        'checkbox' => [
            'label' => ['Checkbox'], // Or a &$GLOBALS['TL_LANG'] pointer
            'inputType' => 'checkbox',
        ],
        'textarea' => [
            'label' => ['Textarea'], // Or a &$GLOBALS['TL_LANG'] pointer
            'inputType' => 'textarea',
        ],
        'text' => [
            'label' => ['Text'], // Or a &$GLOBALS['TL_LANG'] pointer
            'inputType' => 'text',
        ],
    ],
    'eval' => [
        'tl_class' => 'clr',
        'actions' => [ // actions to be shown. Default: 'copy', 'delete' // 'edit' does not work yet
            'copy',
            'delete',
            //'enable', // Enable / Disable
        ],
        //'sortable' => false, // disables sorting the rows
        'min' => 2, // minimum amount of rows
        'max' => 5, // maximum amount of rows
    ],
    'sql' => [
        'type' => 'blob',
        'length' => AbstractMySQLPlatform::LENGTH_LIMIT_BLOB,
        'notnull' => false,
    ],
];

Output

Rendered example of the row wizard based on the configuration

Examples

In some cases, you may not want to save any value if there is only one row and the first value is empty. You can implement your own callback function for the save callback like this:

#[AsCallback(table: 'tl_content', target: 'fields.columnWizardOne.save')]
class ContentTextSaveCallback
{
    public function __invoke($value, DataContainer $dc)
    {
        if ('' === $value) {
            return $value;
        }

        if (0 === \count($values = StringUtil::deserialize($value, true))) {
            return '';
        }

        // Do not reset if there is more than one row
        if (1 !== \count($values)) {
            return $value;
        }

        if (($values[0][array_key_first($values[0])] ?? '') === '') {
            return '';
        }

        return $value;
    }
}

Known limitation

The following fields do not work:

  • any eval rte (tinymce, ace)
  • color picker
  • filetree

If you need those working or any other special features, consider using a more advanced wizard such as contao-multicolumnwizard-bundle instead.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固