sourcebroker/fieldgenerator

Allows to create content of one field based on other fields. Controlled fully by TCA. Support for extbase nested properties.

Installs: 5 369

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 1

Open Issues: 0

Type:typo3-cms-extension

1.2.2 2017-03-21 15:48 UTC

This package is auto-updated.

Last update: 2024-04-21 01:28:35 UTC


README

This extension allows to create content of one field based on other fields. Controlled fully by TCA settings. Support for nested property read. Useful to create record keywords for nested structures.

Installation

Install the extension using composer composer require sourcebroker/fieldgenerator.

Usage

  1. Find TCA config you want to modify and add configuration. Example:

        'fieldsGenerator' => [
             'repositoryClass' => SourceBroker\Recipes\Domain\Repository\RecipeRepository::class,
             'generate' => [
                 'keywords' => [
                     'fields' => 'name,sections.steps.description,sections.ingredients.name',
                     'preg_replace' => [
                         'pattern' => '/[:]/',
                         'replacement' => ''
                     ]
                 ]
             ]
         ],
    
  2. The field is filled with content on record save (hook processDatamap_afterDatabaseOperations).

    You can also use cli command to initial generation of fields:

    For one table:

    php ./typo3/cli_dispatch.phpsh extbase fieldgenerator:generatefortable tx_recipes_domain_model_recipe

    For all tables:

    php ./typo3/cli_dispatch.phpsh extbase fieldgenerator:generateforalltables

TODO

  1. Remove need to set the repositoryClass in TCA config of "fieldsGenerator" section.