CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Using news module twice on website
https://forum.cmsmadesimple.org/viewtopic.php?f=8&t=82292
Page 1 of 1

Author:  babel [ Fri Jun 26, 2020 10:54 am ]
Post subject:  Using news module twice on website

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
\$1:
{news number="5" detailpage='news_detail'}
in the templates.

cms ms: 2.2.14

Author:  webform [ Fri Jun 26, 2020 11:19 am ]
Post subject:  Re: Using news module twice on website

The easiest way is to apply categories to your articles, so on your blog page you have
\$1:
{news number="5" detailpage='news_detail' category='blog'}

and on your article/news page have
\$1:
{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.

Author:  babel [ Fri Jun 26, 2020 12:55 pm ]
Post subject:  Re: Using news module twice on website

Thanks webform for your answer. If I use
\$1:
category="article1, article 2"
the category changes into
\$1:
h1
-tag and it should be
\$1:
<ul class="list1">
<li class="firstnewscat"><a href="#"article1</a></li><li class="firstnewscat"><a href="#"article1</a></li></

Author:  webform [ Fri Jun 26, 2020 2:04 pm ]
Post subject:  Re: Using news module twice on website

I'm not sure i understand what you mean?

Change categories into h1 tag?

When you use your News module tag:
\$1:
{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:
\$1:
{news number="5" detailpage='news_detail' category='category1,category2'}
NOT
\$1:
{news number="5" detailpage='news_detail' category='category1, category2'}

Author:  babel [ Fri Jun 26, 2020 7:58 pm ]
Post subject:  Re: Using news module twice on website  Topic is solved

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

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/