Issue Feature Closed

#52495Allow to implode the output of COA/COA_INT with some glue

Rémy DANIEL 10/03/13, 11:09 updated 06/16/15, 08:30

Description

Many times I need to implode some pieces of content in my output.
In PHP, it is easy : I use implode() function on a array of arbitrary elements.

But in TypoScript, it is such a pain. I need to do multiple .noTrimWrap on all COA elements, and because I don’t know in advance the real number of outputed elements, the final output contains sometimes an unwanted additional glue.

Before :

lib.title.meta = COA
lib.title.meta {
    wrap = <p class="meta">|</p>

    10 = TEXT
    10.data = firstname
    10.noTrimWrap = | - | |
    10.if.isTrue.data = firstname

    20 = TEXT
    20.data = city
    20.noTrimWrap = | - | |
    20.if.isTrue.data = city

    30 = TEXT
    30.data = country
    30.noTrimWrap = | - | |
    30.if.isTrue.data = country
}

After :

lib.title.meta = COA
lib.title.meta {
    wrap = <p class="meta">|</p>

    glue.noTrimWrap = | - ||

    10 = TEXT
    10.data = firstname
    10.if.isTrue.data = firstname

    20 = TEXT
    20.data = city
    20.if.isTrue.data = city

    30 = TEXT
    30.data = country
    30.if.isTrue.data = country
}

Please review the attached patch, and tell me what you think.
I already use this in all of my projects.

Reviews 0

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