[TYPO3-ttnews] List and single on 1 page. Show latest item insingle when opening

Erik Svendsen erik at linnearad.no
Fri Apr 4 21:49:26 CEST 2008


Hello H.E.Weenink | Aristo WebDesign,

The solution is in the manual, but you have to make some changes. Her is 
how I did it

First, I did a TV FCE element, a simple one. I'm using a html template with 
<div class="some">Some text</div>, and map it to a TypoScript Object, for 
instanc lib.tsElement.

Then i put that FCE element on the page where single and list should be (the 
FCE will render the Single through TS). The list was made with a normal News 
plugin.

Made an ext template for that page with the following code.

<--- snip --->
#defining the single news element
lib.tsElement >
lib.tsElement < plugin.tt_news
lib.tsElement {
    code >
    code = SINGLE
    pid_list >
    pid_list = 57
    catImageMode = 0
    catTextMode = 0
    templateFile = fileadmin/templates/news/tt_news_single.html
}

#The rest of the code is from the manual - Default news id - 
#but with the TypoScriptObject lib.tsElement instead of page.10.....
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg = &nbsp;
plugin.tt_news._LOCAL_LANG.no.noNewsIdMsg = &nbsp;
#Same page as the TS/plugin is on
plugin.tt_news.singlePid = 119
plugin.tt_news.templateFile = fileadmin/templates/news/tt_news_single.html

tmp.pagecontent < lib.tsElement                      

lib.tsElement >

lib.tsElement = COA
lib.tsElement {
  10 = CONTENT
  10.table = tt_news
  10.select {
    pidInList = 57
    orderBy = datetime desc
    max = 1
  }
  10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
  20 < tmp.pagecontent
}

<-- snip -->


Working demo: http://example.linnearad.no/index.php?id=119

> Hello there,
> 
> "List and single are on 1 page. Show latest item in single when
> opening. So NOT clicking, just opening page"
> 
> I know this is an old issue (is even in manual how to do this),
> but.... How to do this with TemplaVoila?
> 
> I did a lot of searching in Google, but did not find any trick to get
> this done.
> 
> Hope to get some help, Eef
> 

WBR,
Erik Svendsen
www.linnearad.no




More information about the TYPO3-project-tt-news mailing list