TCA basics · Question 9 of 12

The page properties should get a new field tx_myext_subtitle directly after the title. Which calls belong in Configuration/TCA/Overrides/pages.php?

2 answers are correct. Medium

Show answer

Answer

  • A ExtensionManagementUtility::addToAllTCAtypes('pages', 'tx_myext_subtitle', '', 'after:title')
  • B ExtensionManagementUtility::addTCAcolumns('pages', [...]) with the column definition

Explanation

addTCAcolumns() adds the column to $GLOBALS['TCA']['pages']['columns'], but it would not appear anywhere yet. Only addToAllTCAtypes() adds it to showitem of the page types, the fourth parameter defines the position, e.g. after:title. Page TSconfig can adjust or hide fields, but cannot define new ones, and ctrl.label would make the field the title of all pages.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications