[TYPO3-ttnews] why is retrieving news as Typoscript CONTENT object so demanding of resources?
Erich Specht
erich at erichspecht.com
Thu Aug 1 18:06:17 CEST 2013
I need to retrieve tt_news content via Typoscript as a CONTENT object, but I
am finding that the code below is causing the server to slow down, reboot,
etc. Is there anything I can do to make the SELECT more efficient? Does
retrieving news content in this way not cause the page to cache or
something?
Below is the code I'm using - the commented out version uses plugin.tt_news
and doesn't wreak havoc on the server.
temp.top_right_content= COA
temp.top_right_content {
wrap = <div class="news-list-container">|</div>
10 = CONTENT
10.table = tt_news
10.select.selectFields = image, tt_news.title, tt_news.short, tt_news.uid
10.select.pidInList = {$pid_list_home_right} # uid of the sysfolder where
news records are stored
10.select.recursive = 250 #allow content in subfolders
10.select.max= 20
10.select.begin = 6
10.select.where = uid_foreign IN ( {$categorySelection_home_right} )
10.select.where.insertData=1 #tells it to replace constants or registers
#10.select.andWhere = image > ''
10.select.andWhere = tx_damnews_dam_images > '' AND type = 0
10.select.join = tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local
10.select.orderBy = datetime desc
#render the retrieved data
10.renderObj = COA
10.renderObj {
wrap = <div class="news-list-item">|</div>
5 = IMAGE
5 {
wrap=|
# show it only if inserted
#stdWrap.if.isTrue.field=image
#file.import=uploads/pics/
#file.import.field=image
file.import.stdWrap.listNum = 0
file.width=100
file.height=100
file.import.cObject = USER
file.import.cObject {
userFunc=tx_dam_tsfe->fetchFileList
refField=tx_damnews_dam_images
refTable=tt_news
additional.fileList.field=image
additional.filePath=uploads/pics/
}
stdWrap.typolink {
parameter = {$site_single_pid}
# PAGE_ID_OF_SINGLE_VIEW
# create an cacheable link, that does not
depend on cooluri or realurl.
useCacheHash = 1
# add the additional params
additionalParams.wrap =
&tx_ttnews[tt_news]=|
# data expects special commands
# "&my_extra_param=something" cannot work on
.data
additionalParams.data = field:uid
}
}
#title
10 = TEXT
10.field = title
10.wrap = <h1 class="list_news_title">|</h1>
10.typolink {
parameter = {$site_single_pid}
# PAGE_ID_OF_SINGLE_VIEW
# create an cacheable link, that does not depend on cooluri
or realurl.
useCacheHash = 1
# add the additional params
additionalParams.wrap = &tx_ttnews[tt_news]=|
# data expects special commands
# "&my_extra_param=something" cannot work on .data
additionalParams.data = field:uid
}
#subheader (called short)
20 = TEXT
20.field = short
20.wrap = <p>|</p>
20.stdWrap {
crop = 150 | ... | 1
outerWrap = | > more
}
20.typolink {
parameter = {$site_single_pid}
# PAGE_ID_OF_SINGLE_VIEW
# create an cacheable link, that does not depend on cooluri
or realurl.
useCacheHash = 1
# add the additional params
additionalParams.wrap = &tx_ttnews[tt_news]=|
# data expects special commands
# "&my_extra_param=something" cannot work on .data
additionalParams.data = field:uid
}
}
}
#end temp.top_right_content
lib.field_top_right_content.10 < temp.top_right_content
#lib.field_top_right_content.10 < plugin.tt_news
#lib.field_top_right_content.10 {
# code >
# code = LIST
# templateFile =
fileadmin/templates/redesign2012/MODIFIED_TT_NEWS_TEMPLATES/newstemplateWith
SEO_h1.html
# pid_list = {$pid_list_home_right}
# catImageMode = 0
# catTextMode = 0
# categorySelection = {$categorySelection_home_right}
# catExcludeList = {$catExcludeList_home_right}
# categoryMode = 1
# limit = 20
# #excludeAlreadyDisplayedNews = 0#
# noPageBrowser = 1
# useSubCategories = 1
# recursive = 250
#}
More information about the TYPO3-project-tt-news
mailing list