Review main Merged

92455[FEATURE] Introduce Fluid `render.contentArea/record` ViewHelpers

Matthias Vogel CR +2 V +2 Hard +906 −0 updated 02/04/26, 17:00

Commit message

The new `<f:render.contentArea>` ViewHelper allows theme creators
to render content areas in their Fluid templates.

The new `<f:render.record>` ViewHelper enables individual records
to be rendered in Fluid templates.

Both ViewHelpers enable EventListeners to modify the rendered output.

A content area is a section in the markup that corresponds
to a specific backend layout column (colPos).

Currently, this is especially useful for adding debugging wrappers
or additional HTML structure around content and content areas.
It also establishes best practices to render content in templates,
which can be enhanced internally later.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Simon Praetorius +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Simon Praetorius +1

Issues 1

Files 9

Review log 76102

Show 5777 earlier messages
  1. Matthias Vogel uploaded patch set 1 01/22/26, 09:13

  2. Matthias Vogel marked it work in progress 01/22/26, 09:13

  3. core-ci voted on patch set 1 V -1 01/22/26, 09:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94023

  4. Matthias Vogel uploaded patch set 2 V -1 01/22/26, 14:11

  5. core-ci voted on patch set 2 V -1 01/22/26, 14:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94036

  6. Matthias Vogel uploaded patch set 3 V -1 01/22/26, 14:23

  7. core-ci voted on patch set 3 V +1 01/22/26, 14:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94039

  8. Matthias Vogel marked it ready for review 01/22/26, 15:57

  9. Matthias Vogel marked it work in progress 01/22/26, 16:00

  10. Matthias Vogel marked it ready for review 01/22/26, 16:03

  11. Simon Schaufelberger commented on patch set 3 01/22/26, 16:13

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:20

    ?

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:37

    wrong indentation

    Feature-108726-IntroduceFluidContentAreaViewHelper.rst:5

    should be the same length as the title
  12. Simon Praetorius commented on patch set 3 CR -1 01/22/26, 16:20

    on it
  13. Oli Bartsch commented on patch set 3 01/22/26, 16:23

    I wonder whether we shouldn't move on with https://review.typo3.org/c/Packages/TYPO3.CMS/+/86104 instead. Seems like having a ViewHelper for this is unnecessary.
  14. Benni Mack commented on patch set 3 01/22/26, 16:27

    ContentAreaViewHelper.php:45

    I suggest to also use the "area" as argument. It could numeric or the name of the backend layout identifier, which we introduced in v13. This way, we make everything less "cryptic" ("what is colPos?" is a good newbie question :))
  15. Simon Praetorius uploaded patch set 4 CR -1 V +1 01/22/26, 16:53

  16. Simon Praetorius commented on patch set 4 01/22/26, 17:01

    Reply

    That would probably still require a ViewHelper (probably `<f:render.contentArea>`), which would then receive the whole area and render that, avoiding the for loop altogether. Not sure if it's feasible to get this done in v14? Also, it wouldn't easily cover existing projects or cases we currently can't handle, such as fetching content from a different page.

    ContentAreaViewHelper.php:45 Reply

    I'm not sure if that's feasible at the moment, since it would require parsing backend layouts of other pages. I've added an example to the RST where the colPos is specified with a variable `{content.left.colPos}`. However, we could still rename this to `column`, even if it only takes an integer.
  17. Simon Praetorius commented on patch set 4 01/22/26, 17:01

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:20 Reply

    Done

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:37 Reply

    Done

    Feature-108726-IntroduceFluidContentAreaViewHelper.rst:5 Reply

    Done
  18. Simon Praetorius commented on patch set 4 01/22/26, 17:03

    ContentAreaViewHelper.php:45 Reply

    Ah, sorry, misread that, you want to pass the whole area. See my comment to oli. 😊
  19. core-ci voted on patch set 4 V +1 01/22/26, 17:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94066

  20. Patrick Schriner commented on patch set 4 01/23/26, 08:29

    Unpopular opinion - I don't get the use case for this feature. It's almost 100% the same as assigning the rendered content to a variable (and modifying that variable). The connection between the column and the rendered content is almost implicit; nothing is protecting you from passing contradicting values. The only good thing is triggering an event; but that might be resolved better with a more generic approach.
  21. Matthias Vogel marked it work in progress 01/23/26, 13:26

  22. Matthias Vogel uploaded patch set 5 V +1 01/27/26, 09:06

  23. Matthias Vogel commented on patch set 5 01/27/26, 09:18

    This change is ready for review.

    Reply

    @bo@cedev.de the patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/86104 has breaking changes, so I would prefer not to wait for it. It can easily be integrated into the new `<f:render.contentArea>` for v15.

    Reply

    Good point. I've changed it so that we now have a `<f:render.contentArea area="{content.left}">` View Helper. This allows the same event, but also makes it easier for theme creators.

    ContentAreaViewHelper.php:45 Reply

    I changed it so that we use the contentArea to render the column: `<f:render.contentArea area="{content.left}">`. This uses some code from https://review.typo3.org/c/Packages/TYPO3.CMS/+/83718, but only renders via the current TypoScript rendering. We can later add the "new" render "partial" concept from path 83718 later.
  24. Matthias Vogel marked it work in progress 01/27/26, 09:21

  25. Matthias Vogel uploaded patch set 6 01/27/26, 09:22

  26. Matthias Vogel marked it ready for review 01/27/26, 09:22

  27. core-ci voted on patch set 5 V -1 01/27/26, 10:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94402

  28. Matthias Vogel uploaded patch set 7 01/27/26, 10:15

  29. core-ci voted on patch set 6 V -1 01/27/26, 10:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94403

  30. Matthias Vogel rebased onto patch set 8 01/27/26, 16:57

  31. Oliver Hader uploaded patch set 9 01/27/26, 17:53

  32. Oliver Hader commented on patch set 9 01/27/26, 17:56

    I switched to use `EventDispatcherInterface` and added tests to make sure the events are dispatched.
  33. core-ci voted on patch set 8 V -1 01/27/26, 17:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94442

  34. core-ci voted on patch set 9 V +1 01/27/26, 18:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94445

  35. Chris Müller commented on patch set 9 01/27/26, 19:22

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:64

    ```suggestion The new events can be used by extension authors to enhance the output of ```

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:15

    ```suggestion the new :html:`<f:render.contentArea>` ViewHelper can be used. ```
  36. Matthias Vogel commented on patch set 10 V +1 01/28/26, 06:49

    Published edit on patch set 9.
  37. core-ci voted on patch set 10 V +1 01/28/26, 06:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94476

  38. Matthias Vogel commented on patch set 10 01/28/26, 07:00

    Feature-108726-AddPSR-14RenderContentAreaEvent.rst:64 Reply

    Done

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:15 Reply

    Done
  39. Oli Bartsch commented on patch set 10 01/28/26, 08:04

    Reply

    I'm sure we could get the patch in without breaking changes.
  40. Simon Praetorius commented on patch set 10 01/28/26, 09:39

    ContentAreaViewHelper.php:36

    This will probably not work in docs, let's use `html`/`xml` here. Not sure about typoscript though.

    ContentAreaViewHelper.php:40

    this should be done automatically based on `ViewHelperInterface`

    ContentAreaViewHelper.php:53

    Maybe call it `contentArea` here as well to be consistent to the other VH?

    ContentAreaViewHelper.php:78

    I would call it `ModifyRenderedContentAreaEvent` or something similar, because the rendering already happened and there is no way to skip the default rendering.

    RecordViewHelper.php:35

    Use `html`/`xml` here as well

    RecordViewHelper.php:66

    I would call it `ModifyRenderedRecordEvent` or something similar, because the rendering already happened and there is no way to skip the default rendering.
  41. Matthias Vogel commented on patch set 10 01/28/26, 10:03

    ContentAreaViewHelper.php:36 Reply

    Done

    ContentAreaViewHelper.php:40 Reply

    Done

    ContentAreaViewHelper.php:53 Reply

    Done

    ContentAreaViewHelper.php:78 Reply

    Done

    RecordViewHelper.php:35 Reply

    Done

    RecordViewHelper.php:66 Reply

    Done
  42. Matthias Vogel uploaded patch set 11 V +1 01/28/26, 10:06

  43. core-ci voted on patch set 11 V -1 01/28/26, 10:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94487

  44. Matthias Vogel uploaded patch set 12 V -1 01/28/26, 10:21

  45. core-ci voted on patch set 12 V -1 01/28/26, 10:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94489

  46. Matthias Vogel uploaded patch set 13 V -1 01/28/26, 11:09

  47. core-ci voted on patch set 13 V +1 01/28/26, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94492

  48. Simon Praetorius uploaded patch set 14 V +1 02/01/26, 19:31

  49. Simon Praetorius uploaded patch set 15 02/01/26, 19:40

  50. core-ci voted on patch set 14 V -1 02/01/26, 19:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94780

  51. Simon Praetorius commented on patch set 15 CR +1 V +1 02/01/26, 19:48

    I like the current iteration of this patch. It establishes best practices to render content in Fluid templates regardless of the implementation in the background: For example, we could easily add alternative rendering via partials without the jump back to TypoScript (which we already discussed in the past) without changes in existing templates. Also, once a proper data structure for content areas exists (ideally lazy to only load content that is actually used), the ViewHelpers can be adjusted to also accept that data structur, while the events can do the array conversion on-demand in `getContentAreaConfiguration()` and add the proper object as a separate getter.
  52. Simon Praetorius uploaded patch set 16 CR +1 V +1 02/01/26, 19:50

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

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

  55. Simon Praetorius voted on patch set 16 CR +1 V +1 02/01/26, 20:01

  56. Oliver Hader uploaded patch set 17 CR +1 V +1 02/02/26, 16:25

  57. Matthias Vogel marked it work in progress 02/02/26, 16:32

  58. core-ci voted on patch set 17 V +1 02/02/26, 16:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94828

  59. Matthias Vogel uploaded patch set 18 V +1 02/03/26, 15:54

  60. Matthias Vogel commented on patch set 18 02/03/26, 15:55

    This change is ready for review.

    Reply

    is now depending on that patch
  61. core-ci voted on patch set 18 V +1 02/03/26, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94927

  62. Simon Praetorius commented on patch set 18 02/03/26, 17:22

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:36

    Isn't that just `{content.left}` again with the recent change?

    ContentAreaViewHelper.php:38

    Isn't that just {content.left} again with the recent change?
  63. Matthias Vogel uploaded patch set 19 V +1 02/03/26, 17:33

  64. Matthias Vogel commented on patch set 19 02/03/26, 17:33

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:36 Reply

    Done

    ContentAreaViewHelper.php:38 Reply

    Done
  65. core-ci voted on patch set 19 V +1 02/03/26, 17:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94933

  66. Matthias Vogel rebased onto patch set 20 V +1 02/04/26, 06:38

  67. core-ci voted on patch set 20 V +1 02/04/26, 06:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94968

  68. Matthias Vogel rebased onto patch set 21 V +1 02/04/26, 08:15

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

  70. Simon Praetorius voted on patch set 21 CR +1 V +1 02/04/26, 08:56

  71. Oli Bartsch commented on patch set 21 CR -1 02/04/26, 09:01

    reviewing..
  72. Oli Bartsch commented on patch set 21 02/04/26, 10:47

    This section is duplicated.

    ModifyRenderedContentAreaEvent.php:18

    Let's move this to EXT:fluid

    ModifyRenderedRecordEvent.php:18

    Let's move this to EXT:fluid

    Feature-108726-AddPSR-14ModifyRenderedContentAreaEvent.rst:7

    ```suggestion ================================================================================================= Feature: #108726 - Add PSR-14 Events ModifyRenderedContentAreaEvent and ModifyRenderedRecordEvent ================================================================================================= ```

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:36

    Can we provide `{content.left -> f:render.contentArea()}`?

    Feature-108726-IntroduceFluidRenderRecordViewHelper.rst:37

    Can we provide `{record -> f:render.record()}`?

    RecordViewHelper.php:60

    Let's remove this argument for now.
  73. Oliver Hader commented on patch set 21 CR -1 02/04/26, 10:52

    Testing...
  74. Matthias Vogel uploaded patch set 22 CR +1 V +1 02/04/26, 13:21

  75. Matthias Vogel commented on patch set 22 02/04/26, 13:21

    ModifyRenderedContentAreaEvent.php:18 Reply

    Done

    ModifyRenderedRecordEvent.php:18 Reply

    Done

    Feature-108726-AddPSR-14ModifyRenderedContentAreaEvent.rst:7 Reply

    Done

    RecordViewHelper.php:60 Reply

    Done
  76. Matthias Vogel commented on patch set 22 02/04/26, 13:23

    Reply

    Done
  77. Oli Bartsch commented on patch set 22 02/04/26, 13:32

    Feature-108726-IntroduceFluidRenderRecordViewHelper.rst:66

    Please let's provide an example Template path to let readers understand the templateName cObject code here.
  1. Matthias Vogel uploaded patch set 23 02/04/26, 13:52

  2. Matthias Vogel commented on patch set 23 02/04/26, 13:53

    Feature-108726-IntroduceFluidRenderContentAreaViewHelper.rst:36 Reply

    Done

    Feature-108726-IntroduceFluidRenderRecordViewHelper.rst:37 Reply

    Done
  3. Matthias Vogel uploaded patch set 24 02/04/26, 13:56

  4. Matthias Vogel commented on patch set 23 02/04/26, 13:58

    Feature-108726-IntroduceFluidRenderRecordViewHelper.rst:66 Reply

    Done
  5. Matthias Vogel uploaded patch set 25 02/04/26, 14:15

  6. Oli Bartsch commented on patch set 25 CR +1 V +1 02/04/26, 14:16

    Reply

    Done
  7. Oliver Hader voted on patch set 25 CR +1 V +1 02/04/26, 14:17

  8. core-ci voted on patch set 23 V -1 02/04/26, 14:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95028

  9. core-ci voted on patch set 24 V -1 02/04/26, 14:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95031

  10. core-ci voted on patch set 25 V -1 02/04/26, 14:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95037

  11. Matthias Vogel uploaded patch set 26 CR +1 V +1 02/04/26, 14:37

  12. Matthias Vogel voted on patch set 26 CR -1 02/04/26, 14:55

  13. Matthias Vogel voted on patch set 26 CR 0 02/04/26, 15:06

  14. Matthias Vogel uploaded patch set 27 02/04/26, 15:24

  15. core-ci voted on patch set 26 V -1 02/04/26, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95041

  16. core-ci voted on patch set 27 V +1 02/04/26, 15:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95060

  17. core-ci voted on patch set 26 V +1 02/04/26, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95041

  18. Oliver Hader voted on patch set 27 CR +1 V +1 02/04/26, 16:14

  19. Simon Praetorius commented on patch set 27 02/04/26, 16:17

    ContentAreaViewHelper.php:85

    argument no longer exists
  20. Matthias Vogel uploaded patch set 28 CR +1 V +1 02/04/26, 16:24

  21. Matthias Vogel commented on patch set 27 02/04/26, 16:24

    ContentAreaViewHelper.php:85 Reply

    Done
  22. Simon Praetorius voted on patch set 28 CR +1 V +1 02/04/26, 16:42

  23. Oli Bartsch commented on patch set 28 CR +1 V +1 02/04/26, 16:56

    Reply

    Finished?
  24. Oli Bartsch commented on patch set 28 CR +2 V +2 02/04/26, 17:00

    Reply

    Done
  25. Oli Bartsch merged patch set 29 02/04/26, 17:00