[SOLVED] News module multiple instances on same page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
odo
Forum Members
Forum Members
Posts: 10
Joined: Wed Jul 30, 2008 7:35 pm

[SOLVED] News module multiple instances on same page

Post 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.
Last edited by odo on Mon Nov 23, 2009 7:26 am, edited 1 time in total.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: News module multiple instances on same page

Post by jmcgin51 »

did you notice that the category parameter can accept a comma-separated list?
odo
Forum Members
Forum Members
Posts: 10
Joined: Wed Jul 30, 2008 7:35 pm

Re: News module multiple instances on same page

Post by odo »

problem is I need to place different category summaries in different places on page
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: News module multiple instances on same page

Post 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}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News module multiple instances on same page

Post 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...?
odo
Forum Members
Forum Members
Posts: 10
Joined: Wed Jul 30, 2008 7:35 pm

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

Post 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!
Post Reply

Return to “Modules/Add-Ons”