Additional page property fields in TYPO3 CMS 6.2

What is the recommended method for adding custom page property fields in TYPO3 6.2?
In 4.5, I used TemplaVoila, which had its own page module, and made it easy to add page-level data records.

+1
source share
2 answers

There are several approaches:

  • The vanilla approach:

Create the extension (and with it the file ext_emconf.php), and then create the file ext_tables.sqlin the root of the extension. In it, you can put SQL definitions for new fields by specifying instructions CREATE TABLEfor the page table:

CREATE TABLE pages(
    myNewField int(11) DEFAULT '',
);

SQL- page.

Configuration Array (TCA). , , realurl. , ext_tables.php (uncached), php Configuration/Tca/Overrides ().

, .

  1. TemplaVoila. TYPO3 6.2, , AFAIK.

  2. fluidtypo3 -Ecosystem , fluidpages. , , TemplaVoila, (= ) .

+2

, "DCE" ( ).

DCE , .


, . TCA extTables.php

:

/www/htdocs/website/typo3conf/ext/custom_extension/ext_tables.php

$tmp_itm_extended_columns_pages = array(
    'link_class' => array(
        'exclude' => 0,
        'label' => 'LLL:EXT:itm_extended/Resources/Private/Language/locallang_db.xlf:label.linkClass',
        'config' => array(
            'type' => 'select',
            'items' => array(
                array('Nichts', ''),
                array('Zahnrad', 'icon-afford', 'EXT:custom_extension/Resources/Public/img/icons/icon_preferences_small.png'),
                array('Fabrik', 'icon-factory', 'EXT:custom_extension/Resources/Public/img/icons/icon_factory_small.png'),
                array('Computer', 'icon-software', 'EXT:custom_extension/Resources/Public/img/icons/icon_software_small.png'),
                array('Person', 'icon-jobs', 'EXT:custom_extension/Resources/Public/img/icons/icon_person_small.png'),
                array('Welt', 'icon-world', 'EXT:custom_extension/Resources/Public/img/icons/icon_world_small.png'),
                array('Rohre', 'icon-pipe', 'EXT:custom_extension/Resources/Public/img/icons/icon_pipe_small.png'),
            ),
        ),
    ),
);

ext_tables.sql

#
# Table structure for table 'pages'
#
CREATE TABLE pages (

    link_class text

);
+2

Source: https://habr.com/ru/post/1569253/


All Articles