Display a specific news category on a single page

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.
Post Reply
andy25
Forum Members
Forum Members
Posts: 13
Joined: Thu Jan 22, 2009 2:24 pm

Display a specific news category on a single page

Post by andy25 »

Does anyone know how i can use the categories in the news module to distinguish news items which should be displayed on specific areas of the site.

For example if you were logged in a members only area you may have a seperate category for members only news.  Therefore i would only want to display these items and not a browsable category list.

Any help would be appreciated.
stevew
Forum Members
Forum Members
Posts: 74
Joined: Wed May 21, 2008 7:02 am

Re: Display a specific news category on a single page

Post by stevew »

Create a category, e.g. "members news" (and, if you want, separate members news summary and detail templates) and on the members news page put the tag {news category="members news" summarytemplate="members news summary template" detailtemplate="members news detail template"}.

When you create members news articles, make sure they use the "members news" category.
andy25
Forum Members
Forum Members
Posts: 13
Joined: Thu Jan 22, 2009 2:24 pm

Re: Display a specific news category on a single page

Post by andy25 »

You're a star.  That worked perfectly. 
Thanks.

Whilst you're on...ive uploaded attachements to a specific news item and all the others are registering an attachment except the one its actually associated with...in the admin i can see it attached correctly to the news article. 

Here is the code i used in the template:

  {if $field->type == 'file'}
    file_location}/{$field->value}" class="pdf">{$field->name}
  {/if}

Am i doing something wrong?
stevew
Forum Members
Forum Members
Posts: 74
Joined: Wed May 21, 2008 7:02 am

Re: Display a specific news category on a single page

Post by stevew »

Have you tried with
{if $field->type == 'file'}
file_location}/{$field->value}"/>
{/if}
?
According to the default template in the latest version of News:
"this template assumes that every file uploaded is an image of some sort, because News doesn't distinguish"
andy25
Forum Members
Forum Members
Posts: 13
Joined: Thu Jan 22, 2009 2:24 pm

Re: Display a specific news category on a single page

Post by andy25 »

Yeh this is a problem because they could be PDF's as well.  So it has to be an href.  Unfortunately that example wont work.
Thank you for your input though.

Andy
Post Reply

Return to “CMSMS Core”