Using news module twice on website

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
babel
Forum Members
Forum Members
Posts: 147
Joined: Fri Oct 19, 2012 8:58 pm

Using news module twice on website

Post by babel »

I've got a short question. Hopefully the answer is allso short. Is there a way that I can use the news module for two different pages? One page is for a blog, the other for articles/news. So the content is different. The blog has no categories, the articles have about five.
For both I put the following

Code: Select all

{news number="5" detailpage='news_detail'}
in the templates.

cms ms: 2.2.14
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: Using news module twice on website

Post by webform »

The easiest way is to apply categories to your articles, so on your blog page you have

Code: Select all

{news number="5" detailpage='news_detail' category='blog'}
and on your article/news page have

Code: Select all

{news number="5" detailpage='news_detail' category='news'}
So when you add a new article and select a category it will automatic show on the correct page/category.
babel
Forum Members
Forum Members
Posts: 147
Joined: Fri Oct 19, 2012 8:58 pm

Re: Using news module twice on website

Post by babel »

Thanks webform for your answer. If I use

Code: Select all

category="article1, article 2"
the category changes into

Code: Select all

h1
-tag and it should be

Code: Select all

<ul class="list1">
<li class="firstnewscat"><a href="#"article1</a></li><li class="firstnewscat"><a href="#"article1</a></li></
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

Re: Using news module twice on website

Post by webform »

I'm not sure i understand what you mean?

Change categories into h1 tag?

When you use your News module tag:

Code: Select all

{news number="5" detailpage='news_detail' category='blog'}
Your News Summary Template does automatic generate the needed output for listing your articles.

If you want to change how the News Summary are listed, you can change the News Summary Template in "Layout => Design Manager => Templates".

Either create a new News Summary Template og edit the default one.

BTW! If you want to use multiple categories in the News Module Tag, i belive you can't have spaces between categories. So you should use:

Code: Select all

{news number="5" detailpage='news_detail' category='category1,category2'}
NOT

Code: Select all

{news number="5" detailpage='news_detail' category='category1, category2'}
babel
Forum Members
Forum Members
Posts: 147
Joined: Fri Oct 19, 2012 8:58 pm

Re: Using news module twice on website

Post by babel »

It's without spaces. So I'm happy, thanks to your help, webform.
Locked

Return to “CMSMS Core”