Page 1 of 1

[SOLVED] News module multiple instances on same page

Posted: Fri Nov 20, 2009 2:10 pm
by odo
Hello,

After hours of playing around with news module I gave up, please help anyone...
Simple task - need to display summary of two different categories on main page

Something like this won't work:
{news category='Test' pagelimit='2'}
{news category='Stuff' pagelimit='2'}

If Test category contains items then Stuff displays empty list, and vice versa.
I presume this module just wasn't meant to be used like this.
Any ideas welcome. Thanks.

o.

Re: News module multiple instances on same page

Posted: Fri Nov 20, 2009 2:19 pm
by jmcgin51
did you notice that the category parameter can accept a comma-separated list?

Re: News module multiple instances on same page

Posted: Fri Nov 20, 2009 3:24 pm
by odo
problem is I need to place different category summaries in different places on page

Re: News module multiple instances on same page

Posted: Fri Nov 20, 2009 3:29 pm
by jmcgin51
how about

{capture assign="foo"}{news category='Test' pagelimit='2'}{/capture}
{capture assign="bar"}{news category='Test' pagelimit='2'}{/capture}

then use $foo and $bar to represent your news calls where you want them on the page

i.e.
{$foo}
{$bar}

Re: News module multiple instances on same page

Posted: Sat Nov 21, 2009 1:01 am
by Dr.CSS
News will let you put as many calls on the page as you want, I've done sites that were only news articles every where, 10 to 15 {news} tags on a page, with different parameters of course like categories etc...

So if you are having a problem it may be how it's called or that the articles category is a child of the other or...?

[SOLVED] Re: News module multiple instances on same page

Posted: Mon Nov 23, 2009 7:25 am
by odo
Guys, it was my fault after all (Dr. CSS made me suspicious), it was faulty detail tempalte that prevented displaying stuff (yes I myself made it faulty :-\

Thanks for help, oh and jmcgin51 - {capture assign="foo"} - another powerfeature I was not aware of :) thanks!