Easyconf 

Extension key

easyconf

Version

2.1

Language

en

Author

Roman Büchler

Email

rb@buechler.pro

License

This document is published under the Open Content License available from https://www.openhub.net/licenses/opl.

Rendered

Tue, 10 Mar 2026 13:32:08 +0000


Provides a module to easily configure main aspects from a website.

Once set up the module allows website owners without any TYPO3 knowledge to configure main aspects from the website.


Table of Contents

Latest Stable Version TYPO3 12 Total Downloads Monthly Downloads Continuous Integration Status

Introduction 

This extension provides a module to show a website configuration form allowing users without any technical knowledge to easily configure main aspects from a website.

Behind the scene the extension provides mappers to bind form fields with TypoScript constants, site configuration or the configuration record from the extension. To setup the edit form the following steps are involved:

  1. Define the TCA
  2. If needed create event handlers for advanced configurations

An example setup can be found in the commit 351c6af from the extension pizpalue.

Screenshots 

Website configuration form

Website configuration form

Configuration 

Agency information 

When closing the form editor an info panel is shown providing agency related links. The links can be defined in the site configuration or in the typoscript setup.

easyconf:
  data:
    admin:
      agency:
        email: info@agency.ch
        phone: '111 111 11 11'
        url: 'https://www.agency.ch'
Copied!
module.tx_easyconf {
    settings {
        agency {
            url = info@agency.ch
            phone = 111 111 11 11
            email = https://www.agency.ch
        }
    }
}
Copied!

TCA 

The extension adds the column property tx_easyconf:

$GLOBALS['TCA']['tx_easyconf_configuration']['columns'][$field]['tx_easyconf']
Copied!

It can hold the following properties:

mapAlways

mapAlways
Required

false

data type

boolean

Scope

TypoScript constants

Path

$GLOBALS > TCA > tx_easyconf_configuration > [field] > tx_easyconf

Writes the property value obtained from the field always to the typoscript file, even if the inherited value is equal. The normal behaviour is to write only changed property values to the file. This feature is useful where property values depend on conditions. In such cases the inherited value doesn't necessarily reflect the real value. As an example assume a menu property having a different value on subpages.

mapper

mapper
Required

true

data type

string

Scope

Easyconf mappers

Path

$GLOBALS > TCA > tx_easyconf_configuration > [field] > tx_easyconf

Defines the class used to map the field value to the corresponding configuration.

path

path
Required

true

data type

string

Scope

Easyconf mappers

Path

$GLOBALS > TCA > tx_easyconf_configuration > [field] > tx_easyconf

Defines the property path used my the mapper to read and write the corresponding configuration.

TypoScript constants substitution 

Starting with TYPO3 v12 TypoScript constants aren't substituted any more: The assignment b = {$a} with a = test results in b = {$a} and not in b = test. Especially when configuring various extensions it would be faster to just set some global constants and assign them accordingly. Here the TypoScript substitution feature comes into play:

easyconf.substitutions {
  someExtenstion {
    domain = {$globals.customer.domain}
    dateFormat = {$globals.general.dateFormat}
  }
  someOtherExtension {
    link = <a href="https://www.{$globals.customer.domain}">{$globals.customer.company}</a>
  }
}
Copied!

The above TypoScript constant definition would result in:

someExtension {
    domain = domain.ch
    dateFormat = j. F Y
}
someOtherExtension {
    link = <a href="https://www.domain.ch">Company GmbH</a>
}
Copied!

As demonstrated all constants appearing on the right side from the equal (=) sign become substituted.

User manual 

Restore field values 

To restore inherited values double question marks ?? can be saved as a field value.

Tutorials 

Map form values to TypoScript constants, the site configuration or the easyconf table.

Audience: Integrators, Developers

Using mappers 

Audience: Integrators, Developers

A form value can be mapped to a TypoScript constant, a site configuration property or a field from the configuration table from this extension. The mapping is defined in a php file located under Configuration/TCA/Overrides and assisted by helper functions from the extension TcaUtility class.

Basic TCA-file structure 

<?php

use Buepro\Easyconf\Mapper\EasyconfMapper;
use Buepro\Easyconf\Mapper\SiteConfigurationMapper;
use Buepro\Easyconf\Mapper\TypoScriptConstantMapper;
use Buepro\Easyconf\Utility\TcaUtility;

defined('TYPO3') or die('Access denied.');

if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('easyconf')) {
   return;
}

(static function () {
    $l10nFile = 'LLL:EXT:site_package/Resources/Private/Language/locallang_db.xlf';
    $tca = &$GLOBALS['TCA']['tx_easyconf_configuration'];

    /**
     * Define columns
     */
    $propertyMaps = [
        // ***************************
        // * Here we use the mappers *
        // ***************************
    ];
    $tca['columns'] = TcaUtility::getColumns($propertyMaps, $l10nFile);

    /**
     * Define palettes
     */
    // ...

    /**
     * Modify columns
     */
    // ...

    /**
     * Define type (tabs from the form with palettes and fields)
     */
    // ...

    unset($tca);
})();
Copied!

TypoScript constant mapper 

Description 

On each page where a template record is available TypoScript constants can be altered through form fields. This is achieved by creating a template related file holding the constant definitions and importing this file through the template constants definition.

Definition 

/**
* Define columns
*/
$propertyMaps = [
    TcaUtility::getPropertyMap(
        TypoScriptConstantMapper::class,
        'easyconf.demo',
        'company, domain, firstName, lastName',
        'owner'
    ),
]
Copied!

Mapping result 

Form field TypoScript constant
owner_company easyconf.demo.company
owner_domain easyconf.demo.domain
owner_first_name easyconf.demo.firstName
owner_last_name easyconf.demo.lastName

Site configuration mapper 

Description 

This mapper relates form fields with the site configuration hence writes and reads from the site configuration yaml file.

Definition 

/**
* Define columns
*/
$propertyMaps = [
    TcaUtility::getPropertyMap(
        SiteConfigurationMapper::class,
        'easyconf.data.demo',
        'company, contact, email, phone',
        'agency'
    ),
]
Copied!

Mapping result 

Form field Site configuration property
agency_company easyconf.data.demo.company
agency_contact easyconf.data.demo.contact
agency_email easyconf.data.demo.email
agency_phone easyconf.data.demo.phone

Easyconf mapper 

Description 

This mapper relates form fields with the field fields from the table tx_easyconf_configuration. For each page a template record exists a record is created in the table tx_easyconf_configuration. As a result these form values have a template scope.

Definition 

/**
* Define columns
*/
TcaUtility::getPropertyMap(
    EasyconfMapper::class,
    'demo',
    'showAllProperties',
    'easyconf'
),
Copied!

Mapping result 

Form field Path from fields array
easyconf_demo demo.showAllProperties

Complete code 

<?php

use Buepro\Easyconf\Mapper\EasyconfMapper;
use Buepro\Easyconf\Mapper\SiteConfigurationMapper;
use Buepro\Easyconf\Mapper\TypoScriptConstantMapper;
use Buepro\Easyconf\Utility\TcaUtility;

defined('TYPO3') or die('Access denied.');

if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('easyconf')) {
    return;
}

(static function () {
    $l10nFile = 'LLL:EXT:site_package/Resources/Private/Language/locallang_db.xlf';
    $tca = &$GLOBALS['TCA']['tx_easyconf_configuration'];

    /**
    * Define columns
    */
    $propertyMaps = [
        TcaUtility::getPropertyMap(
            TypoScriptConstantMapper::class,
            'easyconf.demo',
            'company, domain, firstName, lastName',
            'owner'
        ),
        TcaUtility::getPropertyMap(
            SiteConfigurationMapper::class,
            'easyconf.data.demo',
            'company, contact, email, phone',
            'agency'
        ),
        TcaUtility::getPropertyMap(
            EasyconfMapper::class,
            'demo',
            'showAllProperties',
            'easyconf'
        ),
    ];
    $tca['columns'] = TcaUtility::getColumns($propertyMaps, $l10nFile);

    /**
    * Define palettes
    */
    $tca['palettes'] = [
        'paletteCompany' => TcaUtility::getPalette(
            'company, domain',
            'owner'
        ),
    ];

    /**
    * Modify columns
    */
    TcaUtility::modifyColumns(
        $tca['columns'],
        'showAllProperties',
        [
            'onChange' => 'reload',
            'config' => ['type' => 'check', 'renderType' => 'checkboxToggle'],
        ],
        'easyconf'
    );
    TcaUtility::modifyColumns(
        $tca['columns'],
        'firstName, lastName',
        ['displayCond' => 'FIELD:easyconf_show_all_properties:REQ:true'],
        'owner'
    );

    /**
    * Define type (tabs from the form with palettes and fields)
    */
    $tabs = [
        'tabTypoScript' => implode(', ', [
            '--palette--;;paletteCompany',
            TcaUtility::getFieldList('firstName, lastName', 'owner'),
        ]),
        'tabSiteConfiguration' => TcaUtility::getFieldList('company, contact, email, phone', 'agency'),
        'tabEasyconf' => TcaUtility::getFieldList('showAllProperties', 'easyconf'),
    ];
    $tca['types'][0] = TcaUtility::getType($tabs, $l10nFile);

    unset($tca);
})();
Copied!

Changelog for release v2.1.0 

Features 

  • [FEATURE] Provide agency info with typoscript (08.03.2023, 70ccdb3 by Roman Büchler)

Reference 

Generated by:

git log v2.0.0..HEAD --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.

Changelog for release v2.0.0 

Features 

  • [FEATURE] Add TypoScript constant substitution (20.01.2023, 5c4c398 by Roman Büchler)
  • [!!!][FEATURE] Add support for TYPO3 v12.1 (14.12.2022, bbeffce by Roman Büchler)

Bugfixes 

  • [BUGFIX] Build ts constants condition aware (09.02.2023, 205e771 by Roman Büchler)

Breaking changes 

  • [!!!][FEATURE] Add support for TYPO3 v12.1 (14.12.2022, bbeffce by Roman Büchler)

Reference 

Generated by:

git log v1.4.0..6331d744 --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.

Changelog for release v1.4.0 

Features 

  • [FEATURE] Add TCA property mapAlways (22.10.2022, 80b22c8 by Roman Büchler)
  • [BUGFIX][FEATURE] Remove unused typoscript imports (20.10.2022, 367978f by Roman Büchler)

Bugfixes 

  • [BUGFIX][FEATURE] Remove unused typoscript imports (20.10.2022, 367978f by Roman Büchler)
  • [BUGFIX] Replace missing pvh view helper (16.09.2022, 9b721f4 by Roman Büchler)

Reference 

Generated by:

git log v1.3.0..774db1fc --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.

Changelog for release v1.3.0 

Features 

  • [FEATURE] Make module available to users and groups (30.06.2022, 570acfb by Roman Büchler)

Reference 

Generated by:

git log v1.2.0..570acfb3 --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.

Changelog for release v1.2.0 

Features 

  • [FEATURE] Substitute new reference with uid in DataHandlerHook (23.06.2022, 6e7b1cd by Roman Büchler)

Bugfixes 

  • [BUGFIX] Correct relative path in ts constant mapper (16.05.2022, 888049d by Roman Büchler)

Reference 

Generated by:

git log v1.1.0..6e7b1cd2 --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.

Changelog for release v1.1.0 

Features 

  • [FEATURE] Clear page cache upon saving configuration (02.05.2022, 8b56ed9 by Roman Büchler)

Bugfixes 

  • [BUGFIX] Use core icons with inline syntax (02.05.2022, 32bc8e8 by Roman Büchler)
  • [BUGFIX] Correct data type in EasyconfService (27.04.2022, fc1f8de by Roman Büchler)
  • [BUGFIX] Ensure fields property in easyconf service is array (27.04.2022, d9d4de6 by Roman Büchler)

Reference 

Generated by:

git log v1.0.0..2954db84 --pretty="* %s (%cd, %h by %an)" --date=format:%d.%m.%Y --abbrev-commit --grep

Note: The above list contains just commits marked with [FEATURE], [BUGFIX] and [!!!]. Complementary commits are available at Github.