Project

General

Profile

Actions

Feature #52495

closed

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

Added by Rémy DANIEL over 10 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2013-10-03
Due date:
% Done:

0%

Estimated time:
1.00 h
PHP Version:
5.4
Tags:
Complexity:
easy
Sprint Focus:

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.


Files

patch_proposal.diff (1.17 KB) patch_proposal.diff Initial patch Rémy DANIEL, 2013-10-03 11:09
Actions

Also available in: Atom PDF