[TYPO3-german] content object - andwhere - CONCAT()?

horace grant horace3d at gmail.com
Thu Feb 2 17:59:26 CET 2012


hallo,

ich habe mit dem kickstarter eine artists und events tabelle angelegt.

ich möchte jetzt eine liste von artists ausgeben und bei jedem artist
angeben bei welchen events er dabei ist. ein event kann mehrere artists
zugewiesen haben. im feld steht dann z.b.: 1,2,3,4,10,12

wie kann ich das zuverlässig lösen?



hier mein ts:

page.20 = CONTENT
page.20 {
    table = tx_me_artists
    select {
        pidInList = 4
    }
    renderObj = COA
    renderObj.stdWrap.dataWrap = <div id="artist{field:uid}"> | </div>
    renderObj {

        20 = TEXT
        20.field = name

        # find artist's events
        50 = CONTENT
        50 {
            table = tx_me_events
            select {
                pidInList = 2
                # add commas at the beginning and the end
                andWhere.dataWrap = CONCAT(',', artists, ',') like
',%{field:uid}%,' |
            }
            renderObj = COA
            renderObj {
                10 = TEXT
                10.field = name
            }
        }
    }
}



das funktioniert nur, wenn es nur einen artist per event gibt. verwende ich
CONCAT richtig? ich will am anfang und ende einen beistrich hinzufügen,
damit das "like" funktioniert. irgendwas klappt aber nicht.

grüße,
horace


More information about the TYPO3-german mailing list