Hallo zusammen!
Ich habe da ein kleines Problem:
Ich möchte anhand des "header_layout" entsprechend Seiteninhalt ausgeben. Das soll so laufen, dass je nach eingestelltem Layout der eine oder der andere "wrap" dazu benutzt wird. Der jeweilige "wrap" erstell ein bestimmtes Tabellenlayout um den Content herum.
Für das "Normal"-Layout sollen keinerlei Bedingungen gelten.
Für die Überschrift wird das entsprechende Tabellenlayout geöffnet:
lib.stdheader >
lib.stdheader = CASE
lib.stdheader {
key.field = header_layout
1 = TEXT
1.field = header
1.wrap = <table width="249" border="0" cellpadding="0" cellspacing="0"><tr><td width="28" height="30" bgcolor="#FFAA55"></td><td width="9" height="30" bgcolor="#FFEBD8"></td><td width="212" height="30" bgcolor="#FFEBD8" class="headline"><span class="headline"> | </span></td></tr><tr><td colspan="3"> </td></tr>
2 = TEXT
2.field = header
2.wrap = <table width="253" border="8" cellpadding="0" cellspacing="0" bordercolor="#E6E4E4"><tr><td><table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#E6E4E4"><tr> <td><img src="fileadmin/template/main/img/punkt_orange.gif" width="7" height="7"> <span class="headline"> | </span></td></tr>
default < .0
}
Und für den Bodytext wieder geschlossen:
tmp_tt_content_text < tt_content.text
tt_content.text >
tt_content.text = COA
tt_content.text.10 < lib.stdheader
tt_content.text.20 = CASE
tt_content.text.20 {
key.field = header_layout
1 = TEXT
1 {
field = bodytext
fieldRequired = bodytext
wrap = <tr><td colspan="3"><span class="content"> | </span><br></td></tr></table>
parseFunc < tmp_tt_content_text.10.parseFunc
editIcons < tmp_tt_content_text.10.editIcons
}
2 = TEXT
2 {
field = bodytext
fieldRequired = bodytext
wrap= <tr><td><p class="content"> | </p></td></tr></table></td></tr><tr><td height="30" bgcolor="#E6E4E4"><div align="right"><img src="fileadmin/template/main/img/pfeil_rechts.gif" width="11" height="8" border="0"></a></div></td></tr></table>
parseFunc < tmp_tt_content_text.10.parseFunc
editIcons < tmp_tt_content_text.10.editIcons
}
}
Soweit so gut, das klappt bei normalem Text schon ganz gut, jetzt möchte ich das allerdings auch bei Content "Bild" oder "Text mit Bild" machen.
Ich dachte, das ginge analog zum "Text" so:
tmp_tt_content_image < tt_content.image
tt_content.image >
tt_content.image = COA
tt_content.image.10 < lib.stdheader
tt_content.image.20 = CASE
tt_content.image.20 {
key.field = header_layout
1 = IMAGE
1 {
field = image
fieldRequired = image
wrap = <tr><td colspan="3"><span class="content"> | </span><br></td></tr></table>
parseFunc < tmp_tt_content_image.10.parseFunc
editIcons < tmp_tt_content_image.10.editIcons
}
2 = IMAGE
2 {
field = image
fieldRequired = image
wrap= <tr><td><p class="content"> | </p></td></tr></table></td></tr><tr><td height="30" bgcolor="#E6E4E4"><div align="right"><img src="fileadmin/template/main/img/pfeil_rechts.gif" width="11" height="8" border="0"></a></div></td></tr></table>
parseFunc < tmp_tt_content_image.10.parseFunc
editIcons < tmp_tt_content_image.10.editIcons
}
}
Wenn ich das so mache, sehe ich auf meiner Seite aber überhaupt keine Bilder mehr (egal welches Layout, auch nicht die vom "Normal"-Layout).
Frage: Was mache ich hier verkehrt? Wie müsste ich abfragen und wie müsste die Abfrage lauten, wenn ich z.B. "Text mit Bild" abfragen möchte.
Würde mich über eure Antworten sehr freuen.
Grüsse,
Thorsten