Lastest News records
Lastest News records
Hi guys
Currently i have trouble with Lastest News records on homepagee
i am trying to get lastest news title and date , show 5 newest records only. look like this:
This is News title one (12/08/2009)
This is News title two (11/08/2009)
This is News title three (10/08/2009)
This is News title four (09/08/2009)
This is News title five (08/08/2009)
Please help me to do that. does CMSms have tag like this : {news_title} {news_date} and how to show only 5 newest records?
thanks
Currently i have trouble with Lastest News records on homepagee
i am trying to get lastest news title and date , show 5 newest records only. look like this:
This is News title one (12/08/2009)
This is News title two (11/08/2009)
This is News title three (10/08/2009)
This is News title four (09/08/2009)
This is News title five (08/08/2009)
Please help me to do that. does CMSms have tag like this : {news_title} {news_date} and how to show only 5 newest records?
thanks
Re: Lastest News records
create a Summary Template for News, named "title_and_date", and edit it to show the title and date as you want
then use {news number='5' summarytemplate='title_and_date'}
then use {news number='5' summarytemplate='title_and_date'}
Re: Lastest News records
i read the help file, i should create title_and_date.tpl file and upload it to modules/news/templates {news_title} some text {news_date} 
thanks .

thanks .
Last edited by dinoboy on Wed Jan 13, 2010 3:32 am, edited 1 time in total.
Re: Lastest News records
have you looked at the default Summary Template (named "Sample")?dinoboy wrote: thanks, but what should i type in the title_and_date templates?
how to retrieve news title and news date
{news_title} some text {news_date}![]()
Re: Lastest News records
i dont know where to view it? layouts > templates in CMS admin console (i checked but couldnt find it)?? or i must browse it in module/news/template via FTP 

Re: Lastest News records
in the Admin panel, Content > News, then click the Summary Templates tab
Re: Lastest News records
i found it, i create a template file on my pc title_and_date.tpl with this content
and use FTP clients to upload it to modules/news/templates
and in my homepage template i insert this code
then refresh the page, it didnt work, here is the message:
Code: Select all
<div class="lastest_news_title">{$entry->titlelink}</div>
<div class="lastest_news_date">$entry->postdate</div>
<br class="clear" />
and in my homepage template i insert this code
Code: Select all
{news number='5' summarytemplate='title_and_date'}
Code: Select all
string(76) "Smarty error: unable to read resource: "module_file_tpl:News;title_and_date""
Re: Lastest News records
you do not need to use FTP or create any TPL files
On the Summary Templates tab, there is a link to create a new template. Just use that link, then enter the desired template name, and then customize the template as needed.
On the Summary Templates tab, there is a link to create a new template. Just use that link, then enter the desired template name, and then customize the template as needed.
Re: Lastest News records
thank you alot i made it.
actually there is no "create new templates" link in summary template tab, i uploaded direct to FTP. it works now ^^
This is the code i use in "title_and_date"
and in homepage's template i use this code:
it printed exactly what i want, CMSMS is cool, i have to study more about it... i am a Designer , so every website i designed nad cut html, i do need a Coder to make the website live, i think with CMSMS i dont need a Coder anymore, i can keep all money 
thank you again ;)
actually there is no "create new templates" link in summary template tab, i uploaded direct to FTP. it works now ^^
This is the code i use in "title_and_date"
Code: Select all
{foreach from=$items item=entry}
<div class="lastest_news_title">{$entry->titlelink}</div>
<div class="lastest_news_date">{$entry->formatpostdate}</div>
<br class="clear" />
{/foreach}
Code: Select all
{news number='5' summarytemplate='title_and_date.tpl' dateformat="%x"}

thank you again ;)
Last edited by dinoboy on Thu Jan 14, 2010 2:17 am, edited 1 time in total.
Re: Lastest News records
Actually, there IS a "Create a New Template" link in the Summary Template tab. See the image below.dinoboy wrote: thank you alot i made it.
actually there is no "create new templates" link in summary template tab, i uploaded direct to FTP. it works now ^^
(Oh, and this installation of News was renamed to "Announcements" at the client's request. That's why the first tab is labeled "Announcements" instead of "News". Otherwise it's the stock News module.)
Glad you got it working...
Last edited by jmcgin51 on Thu Jan 14, 2010 2:33 am, edited 1 time in total.