Display detail news

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
prefab

Display detail news

Post by prefab »

hello,

I'm using CMS Made Simple 0.13. I have setup a 2 column page to display the news. In column 1 the summary is displayed with {cms_module module="news" number="5"}. When I click on the news the detail is shown on column 2. Is there a way when the page is first displayed for the most recent news detail to be displayed in column 2 without having to click on summary?

thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Display detail news

Post by Dr.CSS »

second column  {cms_module module="news" with one of the parameters below}
from the Help for the News module
Parameters

    * (optional) start="5" - Start at the nth item -- leaving empty will start at the first item.
    * (optional) number="5" - Maximum number of items to display =- leaving empty will show all items.
    * (optional) dateformat="%b %d, %Y" - Format to display the article's post date with. This is based on the strftime function and can be used in your template with $entry->formatpostdate. It defaults to %x, which is the default date format for the sever's locale.
    * (optional) makerssbutton="true" - Make a button to link to an RSS feed of the News items.
    * (optional) category="category" - Only display items for that category. Use * after the name to show children. Multiple categories can be used if separated with a comma. Leaving empty, will show all categories.
    * (optional) moretext="more..." - Text to display at the end of a news item if it goes over the summary length. Defaults to "more..."
    * (optional) summarytemplate="sometemplate.tpl" - Use a separate template for displaying the article summary. It have to live in modules/News/templates.
    * (optional) detailtemplate="sometemplate.tpl" - Use a separate template for displaying the article detail. It have to live in modules/News/templates.
    * (optional) detailpage="pagealias" - Page to display News details in. This can either be a page alias or an id. Used to allow details to be displayed in a different template from the summary.
    * (optional) sortby="news_date" - Field to sort by. Options are: "news_date", "summary", "news_data", "news_category", "news_title". Defaults to "news_date".
    * (optional) sortasc="true" - Sort news items in ascending date order rather than descending.
    * (optional) lang="en_US" - Parameter is used to specify what language to use for display on the frontend. Not all modules support or need this.

      mark
prefab

Re: Display detail news

Post by prefab »

hello Marc,

thanks for your reply. Sorry if I sound obtuse or unclear but I have been at this for some time now and my head is no longer clear. I have read the help file and I have the summary news displaying correctly on a 2 column page. When the page is loaded, column1 contains the summary of the last 5 news and column2 is empty. When I click on a News summary the News detail shows on column2.

What I would like to do is: when the page is loaded, column1 contains the summary of the last 5 news and column2 contains the detail of the most recent news item. I cannot figure out to do this from the help ( or from your answer ). What would be the perameters to use for displaying a single detail news item ?

Cheers
Greg
Power Poster
Power Poster
Posts: 598
Joined: Sun Sep 26, 2004 6:15 pm

Re: Display detail news

Post by Greg »

Put {cms_module module="news" number="1"} in column 2
Greg
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Display detail news

Post by Dr.CSS »

using gregs tag add {cms_module module="news" number="1" summarytemplate="thenameofyourtemplate.tpl"}
then make a copy the default detail template and and take out the {eval var=$entry->summary} part so it wont show the summary above the detail, unless you want that too (it will show up bold) put it in modules/News/templates,  the news module defaults to summarry template for first view so you have to trick it by changing the template, that way you can have a summary and a 'content' and just show the content, other wise you have to put everything in the 'content' box and then you have no summaries on the side....

  HTH
          mark
prefab

Re: Display detail news

Post by prefab »

Mark, Greg,

I have everything up and running. Just a little modification to your instructions. If you use the default detail template instead of the summary you will get an empty column. The detail template must be modified to include the "smarty" loop from the summary template:

Code: Select all

{foreach from=$items item=entry}
...
{/foreach}
Thank you for the information you provided.
Cheers
Locked

Return to “CMSMS Core”