[TYPO3-calendar] cal_ts_service from extended news

Marc Scheib marc at mindbomb.de
Fri Apr 29 01:54:08 CEST 2011


Hello again!

Is it possible to perform queries in the context of

plugin.tx_cal_controller.display.tt_news.event_select

using left join?

I have a query showing desired result when I run it from mysql:

SELECT tt_news.title, tt_news.tx_uid_of_meta_tt_news_record, 
programm.title AS programm
FROM  `tt_news`
LEFT JOIN tt_news AS programm
ON tt_news.tx_uid_of_meta_tt_news_record = programm.uid
WHERE tt_news.tx_uid_of_meta_tt_news_record = 2278

When I convert this into typoscript it seems I cannot access the aliased 
data ("programm"). Is Alias supported or might it be an issue with left 
join? Are there workarounds?

My typoscript for the above query currently looks like this:

plugin.tx_cal_controller.display.tt_news.event_select {
	selectFields (
		tt_news.title,
		tt_news.bodytext,
		tt_news.tx_uid_of_meta_tt_news_record,
		programm.title AS programm
	)
	leftjoin (
		tt_news
		AS programm
		ON tt_news.tx_uid_of_meta_tt_news_record = programm.uid
	)
	where (
		tt_news.tx_uid_of_meta_tt_news_record = 2278
	)
}

plugin.tx_cal_controller.display.tt_news.fieldMapping {
		title = title
		organizer = programm
}

plugin.tx_cal_controller.display.tt_news.externalPlugin = 1
plugin.tx_cal_controller.display.tt_news.externalPlugin {
	singleViewPid = 2978
	additionalParams = tx_ttnews[tt_news]=###ORGANIZER###|
}
plugin.tx_cal_controller.display.tt_news {
	template = path/to/my/cal_ts_service.tmpl
}

-- 
Best Regards!
Marc


On 4/28/11 10:39 PM, Marc Scheib wrote:
> Hi Experts!
>
> I am currently trying to pull some data from an "extended" tt_news table
> into cal_ts_service. The extended field is the uid ("foreign key") of
> another tt_news record with information about that record. By now I
> managed to query that field and display it in the frontend:
>
> plugin.tx_cal_controller {
> display.tt_news {
> event.event < plugin.tx_cal_controller.view.event.event
> externalPlugin = 1
> externalPlugin.singleViewPid = 2978
> externalPlugin.additionalParams =
> tx_ttnews[tt_news]=###ORGANIZER###|tx_ttnews[backPid]=2981
>
> event_select.where = 1=2
> template = path/to/my/cal_ts_service.tmpl
>
> fieldMapping {
> title = title
> description = bodytext
> location = imagecaption
> # recycle organizer marker to show my data
> organizer = tx_uid_of_meta_tt_news_record
> image = image
> }
> }
> }
>
> Of course the ID does not make sense to the frontend users and I would
> like print the title of that news instead. Please:
>
> - Is it possible to have a join'ed query like that in cal_ts_service?
>
> - I have a marker for that field already defined in tt_news. Could it
> probably be easier to use that marker in my cal_ts_service.tmpl instead
> of rewriting the query in cal_ts_service?
>
> Best Regards!
> Marc


More information about the TYPO3-project-calendar mailing list