Issue Feature Rejected

#107264TypoScript: Multiline support for addToList() and removeFromList()

Christian Weiske 08/12/25, 08:24 updated 01/30/26, 11:17

Description

With TYPO3 v11 (and probably up to v13), TypoScript addToList() and removeFromlist() can only be used on a single line.

This leads to unreadable code like

TCEFORM.tt_content.CType.removeItems := addToList(text,textmedia,textpic,,header,bullets,uploads,table,menu_categorized_pages,menu_categorized_content,menu_recently_updated,menu_section_pages,menu_pages,menu_section,menu_sitemap,menu_sitemap_pages,menu_subpages,menu_related_pages,menu_abstract,list,div)

The code would be much more readable when I could use line breaks:

TCEFORM.tt_content.CType.removeItems := addToList(
    text,
    textmedia,
    textpic,

    header,
    bullets,
    uploads,
)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 7

  1. Christian Kuhn commented <span data-processor="relativetime" data-value="2025-08-12T20:58:14+00:00" > 08/12/25, 20:58 </span>

    its possible this could be problematic since typoscript is usually line-oriented. i’d propose to look at the code to see which level needs adaption. if it’s down below in base parser, i’d rather say ‘no’ than ‘yes’. also: we need to have a look how current whitespaces and line breaks are handled and if that may collide.

  2. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-08-12T21:00:26+00:00" > 08/12/25, 21:00 </span>

    TCEFORM.tt_content.CType.removeItems := addToList(text)
    TCEFORM.tt_content.CType.removeItems := addToList(textmedia)
    TCEFORM.tt_content.CType.removeItems := addToList(textpic)
    TCEFORM.tt_content.CType.removeItems := addToList(header)
    TCEFORM.tt_content.CType.removeItems := addToList(bullets)
    TCEFORM.tt_content.CType.removeItems := addToList(uploads)

    gd&r ;)

    (I’ll have a look next week or so to see what breaks, unless you (Christian Weiske) may want to have a look at it yourself?)

  3. Christian Weiske commented <span data-processor="relativetime" data-value="2025-08-18T08:56:25+00:00" > 08/18/25, 08:56 </span>

    Examples for working multiline usage in TypoScript:

    23 = TEXT
    23.value (
      line 1
      line 2
    )
    page.headerData.50 = TEXT
    page.headerData.50.stdWrap.wrap (
      <script>
      ...
      </script>
    )
    TCEFORM.tt_content.CType.removeItems (
      bullets, header, image, table, text, textmedia, textpic, uploads,
      felogin_login,
      menu_abstract, menu_categorized_content, menu_categorized_pages,
    )

    Please have a look, Garvin – I have no understanding of the TS parser.

  4. Garvin Hicking commented <span data-processor="relativetime" data-value="2025-08-18T13:04:37+00:00" > 08/18/25, 13:04 </span>

    Noted, I’ll try to find time for a first shot!

  5. Christian Kuhn commented <span data-processor="relativetime" data-value="2025-08-19T18:48:51+00:00" > 08/19/25, 18:48 </span>

    still unsure if we should do this: the multiline handling for “(…)” is relatively painful in the parser and a deviation from the norm. i’m sure we could implement this for functions, but as said it raises questions on how linebreaks, tabs and whitespaces should be handled when they are actually wanted. this is probably quite a bit of work for probably not that much benefit?

  6. Garvin Hicking commented and changed status New Rejected <span data-processor="relativetime" data-value="2026-01-30T11:17:21+00:00" > 01/30/26, 11:17 </span>

    I finally dug a bit into this. I gave up because this is way to complicated and would be a mess to maintain in the already complex AST parsing; the TypoScript parser, as lolli says, is line oriented. I began to implement cross-line look-forward parsing, but this really opens a huge can of worms and edge-cases.

    Note that your examples are a bit different because these do not work as assignment operators and are parsed as “pass-through”.

    I’m afraid I have to close this as ‘wont do’.

    If anyone is up for the task to implement it at some point and comes up with a patch, feel free to re-open or link the issue. But given the time this lies here without further feeedback I’d argue it’s ok to wrap this up. Sorry!