Hallo ich möchte aus der Tabelle tx_realty_images das Feld "image" auslesen.
Wenn ich die Werte für pidInList und where=object als Zahlen einsetze funktioniert es (s. auskommentierte Zeilen)
Ich möchte jedoch die Werte einsetzen, die ich zuvor aus tx_realty_object gelesen habe?
Weiß jemand Rat?
lib.currentPage = TEXT
lib.currentPage.insertData = 1
lib.currentPage.data = GP:tx_realty_pi1|showUid
temp.realty_pid = COA
temp.realty_pid{
50 = RECORDS
50 {
tables = tx_realty_objects
source < lib.currentPage
dontCheckPid = 1
conf.tx_realty_objects = COA
conf.tx_realty_objects {
10 = TEXT
10.field = pid
10.intval = 1
}
}
}
temp.realty_image=CONTENT
temp.realty_image{
table= tx_realty_images
wrap=|
select{
pidInList<temp.realty_pid
#pidInList = 510
object<lib.currentPage
#object=763
max=1
selectFields=image
where = object=763
andWhere=position=1
}
renderObj=COA
renderObj{
10=TEXT
10{
wrap={TSFE:baseUrl}/uploads/tx_realty/|
field=image
}
}
}
Du übergibst ein komplettes COA an pidInList (erwartet wird eine kommaseperierte Liste).
temp.realty_pid.50.conf.tx_realty_objects.10 ist das Element, was du übergeben willst. Bin aber nicht sicher, ob das so überhaupt funktioniert.
hallo toifel,
funktioniert leider auch nicht.
page.2000 < lib.currentPage
page.2000.wrap = <h1>lib.currentPage = realty object uid: | </h1>
page.5500 <temp.realty_pid
page.5500.wrap = <h1>pid: | </h1>
diese ausgabe funktioniert
und bei record
temp.realty_title = COA
temp.realty_title{
50 = RECORDS
50 {
tables = tx_realty_objects
source < lib.currentPage
dontCheckPid = 1
conf.tx_realty_objects = COA
conf.tx_realty_objects {
10 = TEXT
10.field = title
}
}
}
funktionierts auch
ich hab keinen plan, ich will nur einfach ein bild zum realty_object auslesen 🙁
habs so gelöst
temp.realty_image=CONTENT
temp.realty_image{
table= tx_realty_images
wrap=|
select{
pidInList = 15
recursive = 99
max=1
selectFields=image
where = object = ###realtyobjectuid###
andWhere=position=1
markers{
realtyobjectuid.data = GP:tx_realty_pi1|showUid
}
}
renderObj=COA
renderObj{
10=TEXT
10{
#required=1
wrap={TSFE:baseUrl}/uploads/tx_realty/|
field=image
}
}
}
mit Hilfe von Antwort 3: http://stackoverflow.com/questions/10518494/typoscript-make-transversal-mysql-query-without-use-of-pidinlist-option
Dank an alle