Discussion:
[TYPO3-english] tt_news: list and singelview on same page - no news_id given?
Morten Kjems
2009-06-10 08:16:26 UTC
Permalink
I have a tt_news setup with listview and single view on the same page.

It works fine except if someone navigates to the page directly.

Then the list displays fine but the singelview returns "no news_id given".

As soon as you click on a link in the list the singleview returns that
news element.

Is there a way to force the singleview to display the latest news?

All suggestions most welcome.

/Morten
Philipp Gampe
2009-06-10 21:25:49 UTC
Permalink
None that I know...

but I always use a "hidden" single view page as a suppage of my list page:

eg:
+list
|--singleview (hidden in menu)

if you configure it right, the user doesn't even notice that he is on the
suppage as he can't see the difference

Best Regards
Phil
Post by Morten Kjems
I have a tt_news setup with listview and single view on the same page.
It works fine except if someone navigates to the page directly.
Then the list displays fine but the singelview returns "no news_id given".
As soon as you click on a link in the list the singleview returns that
news element.
Is there a way to force the singleview to display the latest news?
All suggestions most welcome.
/Morten
--
I never knew how good Opera is as a newsreader! Try it!
(used Thunderbird and Evolution before)
Martin Bernt Rud
2009-06-11 05:40:22 UTC
Permalink
Hi Morten,

Try TS:
plugin.tt_news._LOCAL_LANG {
default.noNewsIdMsg =  
de.noNewsIdMsg =  
dk.noNewsIdMsg =  
... and so on ....
}


Remember for search engine purposes to make TITLE unique at each news item.
Someting like:

config.noPageTitle = 2
page.headerData.11 = TEXT
page.headerData.11.field = subtitle // title

[globalVar = HTTP_GET_VARS|tx_ttnews|tt_news>0]
lib.newstitle = COA
lib.newstitle.30 = RECORDS
lib.newstitle.30 {
dontCheckPid = 1
tables = tt_news
source.data = GPvar:tx_ttnews|tt_news
conf.tt_news = TEXT
conf.tt_news.field = title
conf.tt_news.required = 1
}

lib.newstitle.50 = TEXT
lib.newstitle.50.value = : 
[end]

[globalVar = HTTP_GET_VARS|tx_ttnews|tt_news>0]
page.headerData.11 >
page.headerData.11 = TEXT
page.headerData.11 < lib.newstitle
page.headerData.11.wrap = <title>| My page name</title>
[end]

Regards,
Martin
2009/6/10 Philipp Gampe <phil at philippgampe.info>
Post by Philipp Gampe
None that I know...
+list
|--singleview (hidden in menu)
if you configure it right, the user doesn't even notice that he is on the
suppage as he can't see the difference
Best Regards
Phil
Post by Morten Kjems
I have a tt_news setup with listview and single view on the same page.
It works fine except if someone navigates to the page directly.
Then the list displays fine but the singelview returns "no news_id given".
As soon as you click on a link in the list the singleview returns that
news element.
Is there a way to force the singleview to display the latest news?
All suggestions most welcome.
/Morten
--
I never knew how good Opera is as a newsreader! Try it!
(used Thunderbird and Evolution before)
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
Morten Kjems
2009-06-11 15:37:43 UTC
Permalink
Sure then there's no problem because you initiate the
singleview/listview page with a click from a page containing only list view.

I want to initiate the singleview/listview page without a click. But I
can only get the list and not the singleview.

It makes no sense to have a page that only contains a the listview in
this site design...
Rupert Germann
2009-06-11 17:17:24 UTC
Permalink
Post by Morten Kjems
Sure then there's no problem because you initiate the
singleview/listview page with a click from a page containing only list view.
I want to initiate the singleview/listview page without a click. But I
can only get the list and not the singleview.
It makes no sense to have a page that only contains a the listview in
this site design...
search for "Default news id" on this page:
http://typo3.org/documentation/document-library/extension-manuals/tt_news/2.5.2/view/1/7/

hth
rupert
Morten Kjems
2009-06-11 18:24:11 UTC
Permalink
Post by Rupert Germann
http://typo3.org/documentation/document-library/extension-manuals/tt_news/2.5.2/view/1/7/
Thanks Rupert

That would work.

But can I make work when I am using Templa Voila?

/Morten
Morten Kjems
2009-06-15 08:02:42 UTC
Permalink
Hi Rubert
Post by Rupert Germann
http://typo3.org/documentation/document-library/extension-manuals/tt_news/2.5.2/view/1/7/
I found a solution that work for Templa Voila.

The original idea come from Erik Svendsen.

Here is the trick:

First you create a simple FCE may mapping a div tag as a typoscript
object path. You can call the object something like lib.singleview_fce

Then you insert the FCE instedt of the tt_news plugin that displays
singleview.

Now create an ext template on the page where you want both list and
singel view to display.

In this template you build lib.singleview_fce to display tt_news
singleview like this:

### Snippet begin ###

#Getting rid of no news ID given
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg =

#defining the single news element
lib.singleview_fce >
lib.singleview_fce < plugin.tt_news
lib.singleview_fce {
code >
code = SINGLE
pid_list >
pid_list = 44
catImageMode = 0
catTextMode = 0
templateFile = fileadmin/templates/extension_templates/newslist.html
}

#The rest of the code is from the manual - Default news id -
#but with the TypoScriptObject lib.singleview_fce instead of page.10

#Same page as the TS/plugin is on
plugin.tt_news.singlePid = 44
plugin.tt_news.templateFile =
fileadmin/templates/extension_templates/newslist.html

tmp.pagecontent < lib.singleview_fce
lib.singleview_fce >

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

### Snippet end ###

It works just fine. Maybe it was an idea to put this snippet in the
manual so Templa Voila users have this option.

Best regards
Morten

Loading...