[TYPO3-ttnews] List and single on 1 page. Show latestiteminsingle when opening

Erik Svendsen erik at linnearad.no
Wed Apr 16 08:46:14 CEST 2008


Hello H.E.Weenink | Aristo WebDesign,

> Hallo Erik,
> 
> Thank you for the solution. Have been looking for this long time. I
> tried working along your lines, but stil keep seeing:   nonews_id
> Please have a look with me. This is what I did:
> 
> - Made new htmltemplate with div  for the single news.
> - I mapped it as typoscript object and gave it name: lib.NewsSingle
> - I attached this template to my newspage.   (a bit different then FCE
> element, but should work the same. Correct?)
> - On the page I made + template + newssingle with these lines in
> Setup:
> (newslist and single are on same page with PID 97)
> (I see no_news_Id, so that means that at least the single element is
> shown
> on the right place. I think?)
> What am I missing here? Eef
> 

Sorry for late reply. Missed your answer.

Your code looks exactly like mine, and you will find nearly the same code 
in the manual. You can try to check following:

Try without the list plugin on the page, hide it. This should give only the 
single view. If nothing shows, try the following.

Change on this page:
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg = Some text

We want the noNewsIdMsg to show.

In a template one love above this page try

plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg = some other text.

You should then have both messages on the page.

If you only have the second message thats indicates that your single don't 
get rendered. Check the HTML output 


Check that you plugin with list have set the PageId for Single and Page Id 
for back to this page. I dont't think this matters, but I have this settings.

Else I haven't any good advice.

WBR,
Erik Svendsen
www.linnearad.no


> -------snippet here --
> #defining the single news element
> lib.NewsSingle>
> lib.NewsSingle< plugin.tt_news
> lib.NewsSingle{
> code = SINGLE
> pid_list >
> pid_list = 97
> catImageMode = 0
> catTextMode = 0
> templateFile = fileadmin/templates/template_news.html
> }
> 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 = 97
> plugin.tt_news.templateFile = fileadmin/templates/template_news.html
> 
> tmp.pagecontent < lib.NewsSingle
> 
> lib.NewsSingle>
> 
> lib.NewsSingle= COA
> lib.NewsSingle{
> 10 = CONTENT
> 10.table = tt_news
> 10.select {
> pidInList = 97
> orderBy = datetime desc
> max = 1
> }
> 10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
> 20 < tmp.pagecontent
> }
> ----end snippet---
> 
>> -----Oorspronkelijk bericht-----
>> Van: typo3-project-tt-news-bounces at lists.netfielders.de
>> [mailto:typo3-project-tt-news-bounces at lists.netfielders.de]
>> Namens Erik Svendsen
>> Verzonden: vrijdag 4 april 2008 21:49
>> Aan: typo3-project-tt-news at lists.netfielders.de
>> Onderwerp: Re: [TYPO3-ttnews] List and single on 1 page. Show
>> latest iteminsingle when opening
>> 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
>> _______________________________________________ TYPO3-project-tt-news
>> mailing list TYPO3-project-tt-news at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-pro
>> ject-tt-news
>> 




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