Hallo liebe Community.
Ich stehe zur Zeit etwas auf dem Schlauch.
Ich verwende TYPO3 Ver. 3.8.1
Ich möchte in mein Template an einem marker das erste Content Element einer bestimmten Spalte ausgeben. das klappt soweit auch:
marks.INHALT_RAND = CONTENT
marks.INHALT_RAND {
table = tt_content
select {
where = colPos = 3
orderBy = sorting
languageField = sys_language_uid
max = 1
}
}
Wenn sich in dieser Spalte allerdings kein Eintrag befindet, möchte ich ein bestimmtes (fest definiertes) Content Element ausgeben.
Wie kann ich jetzt das TypoScript von oben mit dem folgenden so verbinden, dass der gewünschte Effekt auftritt?
marks.INHALT_RAND = RECORDS
marks.INHALT_RAND {
tables = tt_content
source = 1105
dontCheckPid = 1
}
Ich hoffe ihr könnt mir helfen.
Viele Grüße
Matze
Hi, so genau weiß ich dass auch nicht, aber imo musst du ein COA machen,
in dem du dann entweder den Inhalt der Spalte ausgibst oder halt das fest definierte Contentelement.
temp.WASWEISSICH = COA
temp.WASWEISSICH = CONTENT
temp.WASWEISICH {
table = tt_content
select {
where = colPos = 3
orderBy = sorting
languageField = sys_language_uid
max = 1
}
[else]
temp.WASWEISSICH = RECORDS
temp.WASWEISSICH {
tables = tt_content
source = 1105
dontCheckPid = 1
}
}
so ungefähr stell ich mir das vor. ist vom Syntax her aber bestimmt nicht richtig.
Gruß
Daniel
}
Hi.
Danke schonmal für den Tipp, nur so ganz komme ich mit dem COA nicht zurecht, ich weiß nicht genau, wo und wie ich das if einsetze.
hat da noch jemand einen kleinen Tipp für mich?
Gruß
Matze
Hallo,
COA ist ganz einfach, nur mal ein kl Bsp dazu:
temp.test = COA
temp.test {
10 = HML
10.value = <h1>Test</h1>
20 < styles.content.get
25 = CONTENT
25 {
table = tt_content
...
...
}
30 = TEXT
30.value = Ein Text
}
lg georg
Mit folgendem Code bekomme ich jetzt natürlich einmal das Content Element angezeigt, und darunter das erste Element aus Spalte 3:
marks.TESTCONTENT {
10 = RECORDS
10.tables = tt_content
10.source = 163
10.dontCheckPid = 1
20 = CONTENT
20.table = tt_content
20.select {
where = colPos = 3
orderBy = sorting
languageField = sys_language_uid
max = 1
}
}
wie kann ich das jetzt so beschränken, dass marks.TESTCONTENT.10 nur gerendert wird, wenn marks.TESTCONTENT.20 keinen Inhalt hat?
Gruß
Matze