Hallo,
ich möchte zwei Datensätze zusammenführen. Ich habe ein Masktemplate für Produkte, mit dem ich Contentelemente einbinden kann.
also:
header
content
usw.
Nun möchte ich eine mysql-Abfrage einrichten, die eine Tabelle tx_mask_colors mit der Tabelle tt_content verknüpft.
Kann mir jemand sagen, wie ich das Mache oder ob es vielleicht eine Systematische Übersicht über die Abhängigkeiten von tt_content und tx_mask Tabellen gibt?
So bin ich etwas vorangekommen:
SQL_NO_CACHE tt_content.header, tt_content.pid, tx_mask_colors.tx_mask_colors_title
FROM
tt_content, tx_mask_colors
WHERE
( ( tt_content.header LIKE '%ATP%' ) OR
( tt_content.pid LIKE '%ATP%' ) OR
( tx_mask_colors.tx_mask_colors_title LIKE '%ATP%' ) ) AND
( tt_content.t3_origuid IN(tx_mask_colors.uid) )
allerdings gibt mir das Query immer nur eine Farbe aus, warum?
HMM dieser Schritt ist schon näher dran, vielleicht mit left join verbinden?
SQL_NO_CACHE tt_content.header, tt_content.pid, tx_mask_colors.tx_mask_colors_title
FROM
tt_content ,tx_mask_colors
WHERE
( ( tt_content.header LIKE '%ATP%' ) OR
( tt_content.pid LIKE '%ATP%' ) OR
( tx_mask_colors.tx_mask_colors_title LIKE '%ATP%' ) ) AND
( tt_content.uid = tx_mask_colors.parentid )
Hmm so bekomme ich eine Ausgabe, leider ist tx_mask_colors_title immer null, Warum?
SELECT tt_content.header, tt_content.pid, tx_mask_colors.tx_mask_colors_title
FROM
tt_content
left join tx_mask_colors ON
tx_mask_colors.parentid IN ( tt_content.tx_mask_colors)
WHERE
tt_content.header LIKE '%ATP%'
Also mein Template sieht so aus, ich komme leider nicht weiter. Wäre nett, wenn mir jemand helfen könnnte
<f:if condition="{data.tx_mask_details}">
<f:for each="{data.tx_mask_details}" as="data_item">
<f:cObject typoscriptObjectPath="lib.tx_mask.content">{data_item.uid}</f:cObject><br />
</f:for>
</f:if>