Search

Items tagged with: tx

Klaus Weidenbach
11 years ago
Fetching tx_news with TypoScript
I need to include some news from #tx news into a #direct mail newsletter and it was actually quite simple to do so far, but when I wanted to get the categories I got totally stuck. Last night I thought I make something wrong in defining the CONTENT's select statements, but now I know that the select is correct.

So why is this not working?10 = CONTENT
10 {
table = tx_news_domain_model_news
select {
pidInList = 75
selectFields = tx_news_domain_model_category.title AS tx_news_domain_model_category_title
leftjoin = tx_news_domain_model_news_category_mm
ON (tx_news_domain_model_news_category_mm.uid_local = tx_news_domain_model_news.uid)
JOIN tx_news_domain_model_category
ON (tx_news_domain_model_category.uid = tx_news_domain_model_news_category_mm.uid_foreign)
andWhere.dataWrap = tx_news_domain_model_news.uid = {field:uid}
}
renderObj = COA
renderObj {
5=TEXT
5.value = I am here!
10 = TEXT
10.field = tx_news_domain_model_category_title
10.wrap = |
}
wrap = Category: |
}

The generated SQL works fine when executed directly on the database:
SELECT tx_news_domain_model_category.title AS tx_news_domain_model_category_title, tx_news_domain_model_news.uid as uid, tx_news_domain_model_news.pid as pid, tx_news_domain_model_news.t3ver_state as t3ver_state FROM tx_news_domain_model_news LEFT OUTER JOIN tx_news_domain_model_news_category_mm ON (tx_news_domain_model_news_category_mm.uid_local = tx_news_domain_model_news.uid) JOIN tx_news_domain_model_category ON (tx_news_domain_model_category.uid = tx_news_domain_model_news_category_mm.uid_foreign) WHERE tx_news_domain_model_news.pid IN (75) AND tx_news_domain_model_news.uid = 3 AND tx_news_domain_model_news.deleted=0 AND tx_news_domain_model_news.t3ver_state<=0 AND tx_news_domain_model_news.pid<>-1 AND tx_news_domain_model_news.hidden=0 AND tx_news_domain_model_news.starttime<=1370085120 AND (tx_news_domain_model_news.endtime=0 OR tx_news_domain_model_news.endtime>1370085120) AND (tx_news_domain_model_news.fe_group='' OR tx_news_domain_model_news.fe_group IS NULL OR tx_news_domain_model_news.fe_group='0' OR FIND_IN_SET('0',tx_news_domain_model_news.fe_group) OR FIND_IN_SET('-1',tx_news_domain_model_news.fe_group))
The admin panel also shows the correct numrows for the CONTENT, but renderObj seems not to be executed at all and I have no idea why anymore. For sure it is something obvious again. Need a rest I think. If someone has an idea, let me know.
Categories: TypoScript [remove] , CONTENT [remove]
newer older