Zum Inhalt springen

tt_news und tx_dam via TypoScript verbinden

Erstellt am 23. Februar 2011 · 2 Antworten · letzte Antwort am 24. Februar 2011

Tags: Dateien & FAL, tt_news, Frage

lennart ·

Hallo,
ich habe ein Problem. Folgender code functioniert bei mir, wenn ich ihn im Template setze:

lib.teaserGal < plugin.tt_news
lib.teaserGal {
	templateFile = fileadmin/template/tt_news/template_galleries.html
	code >
	code = LIST
	pid_list >
	pid_list.insertData = 1
	pid_list = {page:uid}
	singlePid = 20
	recursive = 3
	limit = 200	
	alternatingLayouts = 2
	categoryMode = 2
	categorySelection = 20
		
	genericmarkers {
		title1 = TEXT 
		title1.field = tx_lhsixxbase_ah1
		
		title2 = TEXT 
		title2.field = tx_lhsixxbase_ah2
		
		gallery = CONTENT 
		gallery {
			table = tt_news
			select.selectFields = tx_dam.file_path, tx_dam.file_name, tx_dam.uid tx_damUid, tx_dam.title, tx_dam.alt_text, tx_dam.caption, tx_dam.tx_lhsixxbase_description
			select.join = tx_dam_mm_ref ON (tt_news.uid = tx_dam_mm_ref.uid_foreign AND tx_dam_mm_ref.tablenames = 'tt_news' AND tx_dam_mm_ref.ident = 'tx_dam2ttnews_bilder') JOIN tx_dam ON (tx_dam.uid = tx_dam_mm_ref.uid_local AND tx_dam.deleted = 0 AND tx_dam.hidden = 0) JOIN tx_dam_mm_cat ON (tx_dam_mm_cat.uid_local = tx_dam.uid AND tx_dam_mm_cat.uid_foreign = 49)
			select.where = tt_news.deleted = 0 AND tt_news.hidden = 0
			select.andWhere.dataWrap = tt_news.uid = {field:uid}
			select.orderBy = tx_dam_mm_ref.sorting_foreign ASC
			select.max = 4
			
			renderObj = COA 
			renderObj {
				10 = IMAGE 
				10.file.import.dataWrap = {field:file_path}{field:file_name}
				10.file.width = 46c
				10.file.height = 75c
				10.titleText.dataWrap = {field:title}
				10.altText.dataWrap = {field:alt_text}
			}
		}	
	}
}
page.100.marks.COL_LEFT.120 < lib.teaserGal

Wenn ich das gleiche jetzt aber auf das tt_news plugin element umschreibe, also unter "TypoScript für dieses Inhaltselement (plugin.tt_news.[your TS])" volgendes einfüge:

genericmarkers {
	title1 = TEXT 
	title1.field = tx_lhsixxbase_ah1
	
	title2 = TEXT 
	title2.field = tx_lhsixxbase_ah2
	
	gallery = CONTENT 
	gallery {
		table = tt_news
		select.selectFields = tx_dam.file_path, tx_dam.file_name, tx_dam.uid tx_damUid, tx_dam.title, tx_dam.alt_text, tx_dam.caption, tx_dam.tx_lhsixxbase_description
		select.join = tx_dam_mm_ref ON (tt_news.uid = tx_dam_mm_ref.uid_foreign AND tx_dam_mm_ref.tablenames = 'tt_news' AND tx_dam_mm_ref.ident = 'tx_dam2ttnews_bilder') JOIN tx_dam ON (tx_dam.uid = tx_dam_mm_ref.uid_local AND tx_dam.deleted = 0 AND tx_dam.hidden = 0) JOIN tx_dam_mm_cat ON (tx_dam_mm_cat.uid_local = tx_dam.uid AND tx_dam_mm_cat.uid_foreign = 49)
		select.where = tt_news.deleted = 0 AND tt_news.hidden = 0
		select.andWhere.dataWrap = tt_news.uid = {field:uid}
		select.orderBy = tx_dam_mm_ref.sorting_foreign ASC
		select.max = 4
		
		renderObj = COA 
		renderObj {
			10 = IMAGE 
			10.file.import.dataWrap = {field:file_path}{field:file_name}
			10.file.width = 46c
			10.file.height = 75c
			10.titleText.dataWrap = {field:title}
			10.altText.dataWrap = {field:alt_text}
		}
	}	
}

kommen nur die Überschriften, nicht aber die Bilder aus dem CONTENT element.
Hab ich nur irgend etwas kleines übersehen, oder geht hier kein CONTENT element?

für jede hilfe dankbar
Lennart

lennart ·

So, nach langem hin und her, Problem gelößt
select.pidInList = this war schuld bzw dessen Abwesenheit auf die richtige id. Hab das ganze auch noch gedreht, so das das primäre query jetzt tx_dam ist. Sie dann wie folgt aus:

lib.teaserGal < plugin.tt_news
lib.teaserGal {
	templateFile = fileadmin/template/tt_news/template_galleries.html
	code >
	code = LIST
	pid_list >
	pid_list.insertData = 1
	pid_list = {page:uid}
	singlePid = 20
	recursive = 6
	limit = 200	
	alternatingLayouts = 2
	categoryMode = 2
	categorySelection = 20
		
	genericmarkers {
		title1 = TEXT 
		title1.field = tx_lhsixxbase_ah1
		
		title2 = TEXT 
		title2.field = tx_lhsixxbase_ah2
		
		gallery = CONTENT 
		gallery {
		
			table = tx_dam
			select.selectFields = tx_dam.file_path, tx_dam.file_name, tx_dam.uid, tx_dam.title, tx_dam.alt_text, tx_dam.caption, tx_dam.tx_lhsixxbase_description
			select.join = tx_dam_mm_cat ON (tx_dam_mm_cat.uid_local = tx_dam.uid AND tx_dam_mm_cat.uid_foreign = 49) JOIN tx_dam_mm_ref ON (tx_dam.uid = tx_dam_mm_ref.uid_local AND tx_dam_mm_ref.tablenames = 'tt_news' AND tx_dam_mm_ref.ident = 'tx_dam2ttnews_bilder') JOIN tt_news ON (tt_news.uid = tx_dam_mm_ref.uid_foreign AND tt_news.deleted = 0 AND tt_news.hidden = 0)
			select.andWhere.dataWrap = tt_news.uid = {field:uid}
			select.orderBy = tx_dam_mm_ref.sorting_foreign ASC
			select.max = 4
			select.pidInList = 19
	
			renderObj = COA 
			renderObj {
				10 = IMAGE 
				10.file.import.dataWrap = {field:file_path}{field:file_name}
				10.file.width = 46c
				10.file.height = 75c
				10.titleText.dataWrap = {field:title}
				10.altText.dataWrap = {field:alt_text}
			}
		}	
	}
}
page.100.marks.COL_LEFT.120 < lib.teaserGal

und den genericmarkers teil kann man jetzt auch unter "TypoScript für dieses Inhaltselement (plugin.tt_news.[your TS])" verwenden, also

genericmarkers {
		title1 = TEXT 
		title1.field = tx_lhsixxbase_ah1
		
		title2 = TEXT 
		title2.field = tx_lhsixxbase_ah2
		
		gallery = CONTENT 
		gallery {
		
			table = tx_dam
			select.selectFields = tx_dam.file_path, tx_dam.file_name, tx_dam.uid, tx_dam.title, tx_dam.alt_text, tx_dam.caption, tx_dam.tx_lhsixxbase_description
			select.join = tx_dam_mm_cat ON (tx_dam_mm_cat.uid_local = tx_dam.uid AND tx_dam_mm_cat.uid_foreign = 49) JOIN tx_dam_mm_ref ON (tx_dam.uid = tx_dam_mm_ref.uid_local AND tx_dam_mm_ref.tablenames = 'tt_news' AND tx_dam_mm_ref.ident = 'tx_dam2ttnews_bilder') JOIN tt_news ON (tt_news.uid = tx_dam_mm_ref.uid_foreign AND tt_news.deleted = 0 AND tt_news.hidden = 0)
			select.andWhere.dataWrap = tt_news.uid = {field:uid}
			select.orderBy = tx_dam_mm_ref.sorting_foreign ASC
			select.max = 4
			select.pidInList = 19
	
			renderObj = COA 
			renderObj {
				10 = IMAGE 
				10.file.import.dataWrap = {field:file_path}{field:file_name}
				10.file.width = 46c
				10.file.height = 75c
				10.titleText.dataWrap = {field:title}
				10.altText.dataWrap = {field:alt_text}
			}
		}	
	}

vielleicht hilft es ja wem den Tag den ich verloren habe zu sparen 8-)

bis dann
lennart