Review main Abandoned

83721[FEATURE] TYPO3 CMS Content Blocks

Nikita Hovratov CR 0 V 0 Impossible +36694 −4 updated 12/05/24, 19:32

Commit message

This patch introduces the concept of a "Content Block" in form of a
new system extension "content_blocks" into the Core.

A Content Block defines exactly one "Content Type". A YAML file serves
as a basis for this definition. The main concept is to encapsulate all
assets which are needed to define such a type. These assets are TCA,
SQL, XLF and icons for previews. Having this component-based approach
it is now easy to share and reuse single blocks in other projects.

Content Blocks itself is more or less a loader/compiler/generator type
of extension. It is based on already existing functionality and just
adds another abstraction layer.

The structure of a Content Block consists of the EditorInterface.yaml
file, the "Assets" folder with icons and the "Source" folder, which may
contain xlf translations and templates. Only the YAML file is required.

   ├── Assets
   │   └── Icon.svg
   ├── Source
   │   └── Language
   │   │   └── Labels.xlf
   |   ├── EditorPreview.html
   |   └── Frontend.html
   └── EditorInterface.yaml

Single Content Blocks need a host extension to live inside. Depending
on the folder they are placed in, they are interpreted as Content
Elements, Page Types or generic Record Types.

   ├── Classes
   ├── Configuration
   ├── ContentBlocks
   │   ├── ContentElements
   │   │   ├── block1
   │   │   └── block2
   │   ├── PageTypes
   │   │   ├── block3
   │   │   └── block4
   │   └── RecordTypes
   │       ├── block5
   │       └── block6
   ├── Resources
   └── composer.json

The YAML definition defines a project-wide, unique identifier. It also
defines all fields and their position, in which they should appear in
the editing interface (FormEngine):

    name: vendor/content-block-name
    fields:
      - identifier: my_text_field
        type: Text

Asset publishing is done with a trick, as only resources inside
Resources/Public of an extension are allowed to be accessed publicly.
Content Blocks reserves the directory Resources/Public/ContentBlocks
inside extensions and uses this path to symlink (or copy) public assets
on runtime, when Content Blocks are loaded. This way it is possible to
use Core API to retrieve Content Block assets. Also works on windows.

The initial motivation of this extension was to ease the introduction
barrier for TYPO3 beginners and frontend developers to create custom
Content Elements. However, it became apparent this solution has the
potential to generally abstract all parts of TCA including Page Types
and Record (Types).

During the 8-month beta testing phase between Sep. 2023 and May. 2024
this hypothesis got confirmed by many users (24,376 installs on TER at
the time of writing). The mainly positive feedback was received on TYPO3
camps and via Slack.

Hence, it can also be used in many various ways beyond "simple" Content
Elements. For instance you can create custom Page Types like in the
well-known blog extension, which substitutes custom Record Types. Or you
can define your custom Record Types for your extbase extension.
Extending other, existing Record Types with another custom type like for
the news extension is a core functionality. However, it is not possible
to add new fields to existing types as this violates the component-based
approach.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 451

Show 431 more files

Review log 71126

Show 54101 earlier messages
  1. Nikita Hovratov uploaded patch set 1 04/09/24, 17:32

  2. core-ci voted on patch set 1 V -1 04/09/24, 17:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55625

  3. Nikita Hovratov uploaded patch set 2 V -1 04/09/24, 17:54

  4. core-ci voted on patch set 2 V -1 04/09/24, 18:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55629

  5. Nikita Hovratov uploaded patch set 3 V -1 04/09/24, 18:09

  6. core-ci voted on patch set 3 V -1 04/09/24, 18:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55630

  7. Nikita Hovratov uploaded patch set 4 V -1 04/09/24, 19:47

  8. core-ci voted on patch set 4 V -1 04/09/24, 19:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55635

  9. Nikita Hovratov uploaded patch set 5 V -1 04/09/24, 20:24

  10. core-ci voted on patch set 5 V +1 04/09/24, 20:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55637

  11. Nikita Hovratov uploaded patch set 6 V +1 04/09/24, 20:37

  12. core-ci voted on patch set 6 V -1 04/09/24, 20:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55638

  13. Nikita Hovratov uploaded patch set 7 V -1 04/09/24, 21:45

  14. core-ci voted on patch set 7 V -1 04/09/24, 21:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55639

  15. Nikita Hovratov uploaded patch set 8 V -1 04/09/24, 21:59

  16. core-ci voted on patch set 8 V -1 04/09/24, 22:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55640

  17. Nikita Hovratov uploaded patch set 9 V -1 04/09/24, 22:10

  18. core-ci voted on patch set 9 V +1 04/09/24, 22:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55641

  19. Nikita Hovratov uploaded patch set 10 V +1 04/09/24, 22:38

  20. core-ci voted on patch set 10 V +1 04/09/24, 22:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55642

  21. Nikita Hovratov uploaded patch set 11 V +1 04/10/24, 07:49

  22. core-ci voted on patch set 11 V +1 04/10/24, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55669

  23. Nikita Hovratov uploaded patch set 12 V +1 04/11/24, 10:55

  24. Nikita Hovratov uploaded patch set 13 04/11/24, 10:56

  25. core-ci voted on patch set 12 V -1 04/11/24, 11:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55755

  26. core-ci voted on patch set 13 V +1 04/11/24, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55756

  27. Nikita Hovratov uploaded patch set 14 V +1 04/11/24, 21:03

  28. Nikita Hovratov uploaded patch set 15 04/11/24, 21:06

  29. core-ci voted on patch set 14 V -1 04/11/24, 21:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55793

  30. core-ci voted on patch set 15 V +1 04/11/24, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55794

  31. Nikita Hovratov uploaded patch set 16 V +1 04/11/24, 21:12

  32. core-ci voted on patch set 16 V -1 04/11/24, 21:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55796

  33. Lina Wolf commented on patch set 16 CR -1 04/14/24, 07:41

    Temporary -1, Working on Docs
  34. Lina Wolf uploaded patch set 17 CR -1 V -1 04/14/24, 08:15

  35. Lina Wolf uploaded patch set 18 04/14/24, 08:19

  36. core-ci voted on patch set 17 V -1 04/14/24, 08:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55937

  37. core-ci voted on patch set 18 V -1 04/14/24, 08:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55938

  38. Nikita Hovratov uploaded patch set 19 V -1 04/23/24, 08:21

  39. core-ci voted on patch set 19 V +1 04/23/24, 08:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56553

  40. Nikita Hovratov uploaded patch set 20 V +1 04/25/24, 12:47

  41. core-ci voted on patch set 20 V -1 04/25/24, 12:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56701

  42. Nikita Hovratov uploaded patch set 21 V -1 04/25/24, 13:07

  43. core-ci voted on patch set 21 V +1 04/25/24, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56703

  44. Nikita Hovratov uploaded patch set 22 V +1 04/26/24, 09:51

  45. core-ci voted on patch set 22 V -1 04/26/24, 09:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56766

  46. Nikita Hovratov uploaded patch set 23 V -1 04/26/24, 10:30

  47. core-ci voted on patch set 23 V +1 04/26/24, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56770

  48. Nikita Hovratov uploaded patch set 24 V +1 04/26/24, 17:21

  49. core-ci voted on patch set 24 V +1 04/26/24, 17:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56793

  50. Nikita Hovratov uploaded patch set 25 V +1 04/26/24, 18:09

  51. core-ci voted on patch set 25 V +1 04/26/24, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56795

  52. Nikita Hovratov uploaded patch set 26 V +1 04/26/24, 19:30

  53. core-ci voted on patch set 26 V +1 04/26/24, 19:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56800

  54. Nikita Hovratov uploaded patch set 27 V +1 05/01/24, 18:12

  55. core-ci voted on patch set 27 V +1 05/01/24, 18:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57054

  56. Nikita Hovratov uploaded patch set 28 V +1 05/01/24, 18:55

  57. core-ci voted on patch set 28 V +1 05/01/24, 19:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57055

  58. Nikita Hovratov uploaded patch set 29 V +1 05/01/24, 19:38

  59. Nikita Hovratov uploaded patch set 30 05/01/24, 19:40

  60. core-ci voted on patch set 29 V +1 05/01/24, 19:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57056

  61. core-ci voted on patch set 30 V +1 05/01/24, 19:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57057

  62. Nikita Hovratov uploaded patch set 31 V +1 05/02/24, 20:49

  63. core-ci voted on patch set 31 V +1 05/02/24, 20:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57117

  64. Nikita Hovratov uploaded patch set 32 V +1 05/03/24, 20:01

  65. core-ci voted on patch set 32 V +1 05/03/24, 20:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57177

  66. Nikita Hovratov uploaded patch set 33 V +1 05/07/24, 15:26

  67. core-ci voted on patch set 33 V +1 05/07/24, 15:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57358

  68. Nikita Hovratov uploaded patch set 34 V +1 05/22/24, 16:39

  69. core-ci voted on patch set 34 V +1 05/22/24, 16:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58065

  70. Wolfgang Wagner voted on patch set 34 V +1 05/24/24, 06:50

  71. Nikita Hovratov uploaded patch set 35 V +1 05/25/24, 10:53

  72. Nikita Hovratov uploaded patch set 36 05/25/24, 10:54

  73. Nikita Hovratov uploaded patch set 37 05/25/24, 10:59

  74. core-ci voted on patch set 36 V +1 05/25/24, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58207

  75. core-ci voted on patch set 35 V -1 05/25/24, 11:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58206

  76. core-ci voted on patch set 37 V -1 05/25/24, 11:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58208

  77. Nikita Hovratov uploaded patch set 38 V -1 05/25/24, 11:10

  78. core-ci voted on patch set 38 V -1 05/25/24, 11:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58210

  79. Nikita Hovratov uploaded patch set 39 V -1 05/25/24, 11:19

  80. core-ci voted on patch set 39 V +1 05/25/24, 11:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58211

  81. Nikita Hovratov uploaded patch set 40 V +1 05/25/24, 12:23

  82. core-ci voted on patch set 40 V +1 05/25/24, 12:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58214

  83. Nikita Hovratov uploaded patch set 41 V +1 05/26/24, 14:11

  84. core-ci voted on patch set 41 V +1 05/26/24, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58285

  85. André Kraus voted on patch set 41 CR +1 V +1 05/27/24, 18:45

  86. Jonas Eberle voted on patch set 41 V +1 05/28/24, 11:36

  87. Nikita Hovratov uploaded patch set 42 CR +1 V +1 05/28/24, 13:34

  88. core-ci voted on patch set 42 V -1 05/28/24, 13:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58402

  89. core-ci voted on patch set 42 V +1 05/28/24, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58402

  90. Benjamin Kott commented on patch set 42 05/29/24, 09:53

    All feedback provided before seems to be still open. Currently writing a summery of open tasks. Patch cannot get in as is.
  91. Benjamin Kott commented on patch set 42 CR -2 05/29/24, 09:53

    All feedback provided before seems to be still open. Currently writing a summery of open tasks. Patch cannot get in as is.
  92. Nikita Hovratov uploaded patch set 43 V +1 05/31/24, 14:57

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  93. core-ci voted on patch set 43 V +1 05/31/24, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58533

  94. Nikita Hovratov uploaded patch set 44 V +1 06/01/24, 21:54

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  95. core-ci voted on patch set 44 V +1 06/01/24, 21:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58573

  96. Nikita Hovratov uploaded patch set 45 V +1 06/17/24, 14:23

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  97. core-ci voted on patch set 45 V +1 06/17/24, 14:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59735

  98. Lina Wolf wrote 08/02/24, 08:14

    Removed reviewer Lina Wolf.
  99. Nikita Hovratov uploaded patch set 46 V +1 08/27/24, 22:34

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  100. Benni Mack commented on patch set 46 08/27/24, 22:38

    RootLevelType.php:23

    let's bring that one in Core (as a prepatch) please

    TabFieldType.php:36 Unresolved

    we could maybe add this to TcaSchema in EXT:core as a separate patch
  101. core-ci voted on patch set 46 V -1 08/27/24, 22:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64368

  1. Nikita Hovratov uploaded patch set 47 V -1 08/27/24, 22:48

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  2. core-ci voted on patch set 47 V -1 08/27/24, 22:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64369

  3. Nikita Hovratov uploaded patch set 48 V -1 08/28/24, 05:33

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  4. core-ci voted on patch set 48 V -1 08/28/24, 05:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64381

  5. Nikita Hovratov uploaded patch set 49 V -1 08/28/24, 05:52

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  6. core-ci voted on patch set 49 V +1 08/28/24, 05:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64383

  7. Nikita Hovratov uploaded patch set 50 V +1 08/28/24, 06:51

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  8. core-ci voted on patch set 50 V -1 08/28/24, 06:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64385

  9. Nikita Hovratov uploaded patch set 51 V -1 08/28/24, 07:06

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  10. core-ci voted on patch set 51 V +1 08/28/24, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64386

  11. Benjamin Franzke commented on patch set 51 08/28/24, 07:22

    FieldType.php:25

    I think `FieldType` enum needs to go away, because field types are dynamic, thanks to `FieldTypeRegistry` (I know FieldTypeRegistry was added late because of our desire for custom field types, and therefore `FieldType` was good before)

    FieldTypeRegistry.php:33

    This needs to be a TaggedLocator for performance reasons (otherwise all field types are initialized).

    FileFieldType.php:57

    I'd love if field types could use CPP for allowed settings, as with the current approach, there will be no error handling for wrong/too-many input variable names. With CPP objects would be initialized with `new $fieldType(...$settings)` and PHP would automatically check types and required properties. see https://github.com/TYPO3/typo3/blob/bc25c2f2c81cd872c85665a214fde1b19eca2fa7/typo3/sysext/core/Classes/Settings/SettingDefinition.php#L25 and https://github.com/TYPO3/typo3/blob/bc25c2f2c81cd872c85665a214fde1b19eca2fa7/typo3/sysext/core/Classes/Site/Set/SetDefinition.php#L28 usage with automatic error checking thanks to PHP: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Site/Set/YamlSetDefinitionProvider.php#L90-L109

    Index.rst:20

    I'd like to change this premise. I think Content Blocks need to be a first class citizen and the go-to way for defining content elements. Justification: It is important for agencies and developers to have an easy choice which tool to use. If it turns out a tool is too simplified for a complex usecase, the tool will not be used again, as the risk is to high, having to throwaway a bunch of work and writing complex migrations, once the usecase is too complex for content blocks. The idea of content blocks needs to be to handle *all* content element usecases. All non content-block content elements should be considered legacy.
  12. Benjamin Franzke commented on patch set 51 08/28/24, 07:28

    swiffy-slider.min.js:1 Unresolved

    third party frontend dependencies would need to be managed by npm/grunt, in order to allow us to track required updates.
  13. Benni Mack commented on patch set 51 09/05/24, 18:07

    RootLevelType.php:23 Reply

    We have RootLevelCapability in Core already - maybe this helps?
  14. Nikita Hovratov commented on patch set 51 09/05/24, 18:26

    RootLevelType.php:23 Reply Unresolved

    Hm, not so much because I introduced these new identifiers as alternative to the integer values. We could do the same renaming in TCA, but I don't know if it's worth just for the sake of renaming.
  15. Nikita Hovratov commented on patch set 51 09/18/24, 16:44

    FieldTypeRegistry.php:33 Reply

  16. Nikita Hovratov commented on patch set 51 09/20/24, 13:46

    FieldType.php:25 Reply

  17. Nikita Hovratov commented on patch set 51 09/20/24, 14:00

    FileFieldType.php:57 Reply Unresolved

    I also would love to have stricter type checking. But we need to take care of some specialties like dynamic properties: https://docs.typo3.org/p/contentblocks/content-blocks/main/en-us/YamlReference/FieldTypes/Select/Index.html#confval-select-allowedcustomproperties And our trait "WithCommonProperties". Either way this looks a little bit complex and would need some cooperation between us to get such a task in.
  18. Nikita Hovratov commented on patch set 51 10/09/24, 08:53

    Index.rst:20 Reply

    I've adjusted the note in the introduction accordingly.
  19. Nikita Hovratov uploaded patch set 52 V +1 10/09/24, 17:15

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  20. core-ci voted on patch set 52 V -1 10/09/24, 17:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67458

  21. Nikita Hovratov uploaded patch set 53 V -1 10/10/24, 17:45

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  22. core-ci voted on patch set 53 V -1 10/10/24, 17:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67526

  23. Nikita Hovratov uploaded patch set 54 V -1 10/10/24, 19:11

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  24. core-ci voted on patch set 54 V +1 10/10/24, 19:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67535

  25. Nikita Hovratov abandoned the change 12/05/24, 19:32

    The third attempt will start with a fresh patch.