Review main Merged

86104[FEATURE] Introduce ContentArea

Oli Bartsch CR +2 V +2 Hard +559 −91 updated 02/04/26, 08:54

Commit message

A new ContentArea object is introduced and contains
next to the area specific information like the
column identifier, the colPos, the slideMode, etc.
also the corresponding records (content elements).

The new object is added as a Closure to the page
layout and initializes on access only => resolving
the content elements only when needed.

Additionally, the content areas are packed into
the new ContentAreaCollection, which allows access
via the known syntax in fluid by implementing the
PSR-11 ContainerInterface.

The ContentArea is based on the new ContentAreaInterface.
The interface allows third-party tools like EXT:container,
to create area objects for nested areas.

The PAGEVIEW cObject automatically exposes this
collection to the view using the varibale name
defined via the "contentAs" option or by falling
back to "content". This further reduces the
necessary TypoScript for rendering a page
and most likely make the PageContentFetchingProcessor
obsolet.

Using the ContentArea it's now also possible for
each content element to know the exact context
in which it should be rendered. This allows
to vary in used Layouts and Partials, depending
on e.g. the colPos the element is rendered in
=> skip the header in case the element is
rendered in the sidebar area.

Side note: An identifier for a column will be
mandatory in v15. For now a fallback is applied
(using a hash of the layout name and the colPos).

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Garvin Hicking +1
    • Simon Praetorius +1
    • Nikita Hovratov +1
    • Matthias Vogel +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Simon Praetorius +1
    • Nikita Hovratov +1
    • Matthias Vogel +1
    • core-ci +1 CI

Issues 1

Files 17

Review log 5377

Show 3452 earlier messages
  1. Oli Bartsch uploaded patch set 1 09/15/24, 09:44

  2. core-ci voted on patch set 1 V -1 09/15/24, 09:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65801

  3. Oli Bartsch uploaded patch set 2 V -1 09/15/24, 09:54

  4. core-ci voted on patch set 2 V +1 09/15/24, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65802

  5. Oli Bartsch uploaded patch set 3 V +1 09/15/24, 12:43

  6. core-ci voted on patch set 3 V +1 09/15/24, 12:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65808

  7. Oli Bartsch uploaded patch set 4 V +1 09/16/24, 09:05

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

  9. Oli Bartsch uploaded patch set 5 V -1 09/16/24, 09:31

  10. core-ci voted on patch set 5 V -1 09/16/24, 09:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65865

  11. Oli Bartsch uploaded patch set 6 V -1 09/16/24, 09:42

  12. Oli Bartsch uploaded patch set 7 09/16/24, 09:49

  13. core-ci voted on patch set 6 V +1 09/16/24, 09:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65866

  14. core-ci voted on patch set 7 V +1 09/16/24, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65867

  15. Simon Praetorius commented on patch set 7 09/16/24, 11:14

    Feature-103894-AdditionalPropertiesForColumnsInPageLayouts.rst:40

    Maybe also reference PAGEVIEW here, as the data processor is not necessary in that case anymore?

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:34

    keyword => property ?

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:37

    (where :html:`main` is the identifier, as defined in the page layout and :html:`content` is the default variable name).

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:48

    are => is

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:90

    remove "Tests" from path

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:95

    To make the RST consistent, this should specify the area variable used below: <f:render partial="ContentElement" arguments="{record: record, area: content.main}" />

    ContentAreaResolver.php:54

    I think this new approach requires one SQL per content area, while the old approach required only 1+n (one for all non-slide areas combined, one for each slide area). Not sure if this is problematic. The new code is much clearer though.

    PageViewContentObject.php:143

    This is added to not be breaking I guess? Because all other variables are just reserved and don't provide a way to adjust their names.

    PageViewContentObject.php:150

    Small nitpick: If this variable is set before `page`, it will be easier for users to see the object's content when using the f:debug VH. Maybe we can adjust the order? Same for language vs. site btw. language should be defined first.
  16. Christian Kuhn voted on patch set 7 CR -2 09/16/24, 13:46

  17. Christian Kuhn commented on patch set 7 CR 0 09/16/24, 15:44

    i suggest to not get this merged 1 day before FF anymore: most of the involved code is very young and we should probably wait for proof they are working as intended before adding more on top of it. i'll not upvote the current solution.
  18. Benni Mack marked it work in progress 03/22/25, 12:32

  19. Simon Praetorius uploaded patch set 8 V +1 01/23/26, 09:40

  20. Simon Praetorius commented on patch set 8 01/23/26, 09:45

    I've resolved the conflicts to the best of my knowledge. Noteworthy: * I'm not sure if `ContentAreaResolver` still covers everything that was removed from `PageLayoutResolver` and `PageContentFetchingProcessor`, however it worked in my (very simple) local setup * The patch breaks the existing `AfterContentHasBeenFetchedEvent` signature because of the lazy fetching using objects. I've fixed it temporarily to get the tests green. We probably could provide the array there, but then lazy would be cancelled out. * Of course, version-related stuff (deprecations...) still needs to be adjusted
  21. core-ci voted on patch set 8 V -1 01/23/26, 09:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94144

  22. Simon Praetorius uploaded patch set 9 V -1 01/23/26, 09:51

  23. core-ci voted on patch set 9 V +1 01/23/26, 10:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94146

  24. Simon Praetorius commented on patch set 9 01/23/26, 12:49

    AfterContentHasBeenFetchedEvent.php:29

    This would be a breaking change
  25. Oli Bartsch uploaded patch set 10 V +1 02/02/26, 16:25

  26. Oli Bartsch commented on patch set 10 02/02/26, 16:26

    This change is ready for review.

    Feature-103894-AdditionalPropertiesForColumnsInPageLayouts.rst:40 Reply

    Since v13 is released, we should not update this changelog anymore.

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:34 Reply

    Done

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:37 Reply

    Done

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:48 Reply

    Done

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:90 Reply

    Done

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:95 Reply

    Done

    ContentAreaResolver.php:54 Reply

    I refactored the initial code intentionally to be much more intuitive. I don't think that one query per area will increase load notably.

    PageViewContentObject.php:143 Reply

    Exactly current default when manually calling "page-content" is "content".

    PageViewContentObject.php:150 Reply

    Is this still relevant after the latest changes to the debugging infrastructure?

    AfterContentHasBeenFetchedEvent.php:29 Reply

    Done
  27. core-ci voted on patch set 10 V +1 02/02/26, 16:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94829

  28. Matthias Vogel uploaded patch set 11 V +1 02/02/26, 18:26

  29. Matthias Vogel uploaded patch set 12 02/02/26, 18:30

  30. core-ci voted on patch set 12 V +1 02/02/26, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94843

  31. Matthias Vogel uploaded patch set 13 V +1 02/02/26, 18:43

  32. Matthias Vogel voted on patch set 13 CR +1 V +1 02/02/26, 18:43

  33. core-ci voted on patch set 11 V -1 02/02/26, 19:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94842

  34. core-ci voted on patch set 13 V +1 02/02/26, 19:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94844

  35. Oli Bartsch uploaded patch set 14 CR +1 V +1 02/03/26, 08:34

  36. Matthias Vogel voted on patch set 14 CR +1 V +1 02/03/26, 08:35

  37. core-ci voted on patch set 14 V +1 02/03/26, 08:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94871

  38. Nikita Hovratov voted on patch set 14 CR +1 02/03/26, 09:11

  39. Simon Praetorius commented on patch set 14 CR -1 02/03/26, 09:34

    reviewing...
  40. Simon Praetorius commented on patch set 14 02/03/26, 10:07

    ContentAreaCollection.php:59

    Looking at the deleted code, I think this is a different structure than before: before: ['colPos' => 123, ..., 'records' => [...]] after: ['area' => ContentAreaInterface, 'records' => [...]]

    ContentAreaInterface.php:28

    After a discussion with @typo3@kanti.de, I would argue that we should leave out this interface in the first step. The current interface seems to broad to me, this should be multiple interfaces in my opinion. As we can always add interfaces later and the immediate todos (e. g. using this in EXT:container) can be solved without the interface, I would skip this for now and stick to an `@internal` final class.

    ContentAreaResolver.php:48

    ```suggestion // @deprecated Identifier has to be set -> throw exception in v15 ```
  41. Simon Praetorius commented on patch set 14 02/03/26, 10:10

    ContentAreaResolver.php:54 Reply

    Acknowledged

    PageViewContentObject.php:150 Reply

    Acknowledged
  42. Benni Mack commented on patch set 14 02/03/26, 13:36

    PageLayoutResolver.php:47

    should be the EventDispatcherInterface

    ResolveContentAreasEvent.php:25

    Event in EXT:core depends on code in EXT:backend? I mean, if there is no other way, then that's it but surely not ideal.

    Productdetail.fluid.html:5

    should we rather do an implode here?
  43. Matthias Vogel uploaded patch set 15 CR +1 V +1 02/03/26, 13:41

  44. Matthias Vogel uploaded patch set 16 02/03/26, 13:46

  45. core-ci voted on patch set 15 V -1 02/03/26, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94908

  46. Matthias Vogel uploaded patch set 17 02/03/26, 13:59

  47. Matthias Vogel commented on patch set 17 02/03/26, 13:59

    ContentAreaCollection.php:59 Reply

    Done

    ContentAreaInterface.php:28 Reply

    Done

    PageLayoutResolver.php:47 Reply

    Done

    ContentAreaResolver.php:48 Reply

    Done
  48. Matthias Vogel uploaded patch set 18 02/03/26, 14:10

  49. core-ci voted on patch set 17 V -1 02/03/26, 14:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94913

  50. Matthias Vogel commented on patch set 18 02/03/26, 14:10

    ResolveContentAreasEvent.php:25 Reply

    in PageLayoutResolver there already is a dependency on EXT:backend. To remove that dependency we would need to refactor alot of code.

    Productdetail.fluid.html:5 Reply

    Done
  51. core-ci voted on patch set 16 V +1 02/03/26, 14:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94911

  52. core-ci voted on patch set 18 V +1 02/03/26, 14:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94916

  1. Matthias Vogel uploaded patch set 19 V +1 02/03/26, 15:16

  2. core-ci voted on patch set 19 V -1 02/03/26, 15:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94923

  3. Matthias Vogel uploaded patch set 20 V -1 02/03/26, 15:31

  4. Matthias Vogel voted on patch set 20 CR +1 V +1 02/03/26, 16:00

  5. core-ci voted on patch set 20 V -1 02/03/26, 16:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94925

  6. core-ci voted on patch set 20 V +1 02/03/26, 16:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94925

  7. Simon Praetorius voted on patch set 20 CR +1 V +1 02/03/26, 17:09

  8. Oli Bartsch commented on patch set 20 02/03/26, 17:12

    Productdetail.fluid.html:5 Reply

    I did not know the ViewHelper for this. Looks much better now.
  9. Nikita Hovratov commented on patch set 20 CR -1 02/03/26, 20:56

    reviewing
  10. Nikita Hovratov uploaded patch set 21 CR +1 V +1 02/03/26, 21:54

  11. core-ci voted on patch set 21 V +1 02/03/26, 22:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94948

  12. Nikita Hovratov uploaded patch set 22 V +1 02/03/26, 22:05

  13. Nikita Hovratov voted on patch set 22 CR +1 V +1 02/03/26, 22:06

  14. core-ci voted on patch set 22 V +1 02/03/26, 22:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94949

  15. Simon Praetorius voted on patch set 22 CR +1 V +1 02/03/26, 22:14

  16. Garvin Hicking commented on patch set 22 02/03/26, 22:28

    (just thoughts, not forcing revotes)

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:103

    ```suggestion Introducing :php:`ContentArea` also improves the ``` (can be done post-merge)

    ContentAreaResolver.php:84

    named arguments here?

    PageViewContentObject.php:168

    ```suggestion 'No variable name ("contentAs" option) for the content areas has been defined in PAGEVIEW, and the fallback name "content" is not available because it has been manually set.', ```
  17. Oli Bartsch uploaded patch set 23 CR +1 V +1 02/04/26, 07:58

  18. Oli Bartsch commented on patch set 23 02/04/26, 07:58

    Feature-104974-ContentAreaRelatedInformationInTheFrontend.rst:103 Reply

    Done

    ContentAreaResolver.php:84 Reply

    Done

    PageViewContentObject.php:168 Reply

    Done
  19. Nikita Hovratov voted on patch set 23 CR +1 V +1 02/04/26, 08:05

  20. core-ci voted on patch set 23 V +1 02/04/26, 08:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94972

  21. Matthias Vogel voted on patch set 23 CR +1 V +1 02/04/26, 08:14

  22. Garvin Hicking voted on patch set 23 CR +1 02/04/26, 08:16

  23. Simon Praetorius voted on patch set 23 CR +1 V +1 02/04/26, 08:18

  24. Oli Bartsch voted on patch set 23 CR +2 V +2 02/04/26, 08:54

  25. Oli Bartsch merged patch set 24 02/04/26, 08:54