Author |
Message |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Fri Mar 14, 2008 6:57 am |
|
Is it possible to limit the number of articles shown in a block.
The feed I am currently showing has about 20 articles in it, but I would like to limit it to the first 5 only.
Any help would be greatly appreciated.
Jakec |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Fri Mar 14, 2008 9:22 am |
|
Already requested, but this would require changes to block administration. Don't expect that anytime soon.  |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Fri Mar 14, 2008 10:18 am |
|
If you are comfortable modding mainfile you can make the following modification down in the headlines function:
Code: $start = 0;
$end = 10;
foreach($feed->get_items($start,$end) as $item) {
|
This is around line 1255 in the 2.20.01 distribution. The $end variable will be the maximum number of items read for ALL your feed blocks. This is just a temporary hack until we can modify blocks.php to allow for a separate maximum number of items to be specified for each block as Kguske says. |
|
|
|
 |
jakec

|
Posted:
Fri Mar 14, 2008 10:56 am |
|
Thanks, a simple hack will do, I don't want more than 5 feeds in any of the blocks so that is OK.  |
|
|
|
 |
jakec

|
Posted:
Fri Mar 14, 2008 1:26 pm |
|
Cheers that worked a treat.  |
|
|
|
 |
CodyG
Life Cycles Becoming CPU Cycles

Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Wed Jun 03, 2009 11:48 am |
|
Is there an update to this issue in rn 2.3? I can't find $end in mainfile.php and would like to limit the number of feeds. |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
 |
jakec

|
Posted:
Wed Jun 03, 2009 11:51 am |
|
You shouldn't need to do this anymore. In the blocks editer there is an option called 'Maximum RSS items' if you set this to 5, 10, or whatever this should limit the number of items in the feed.
I hope this helps. |
|
|
|
 |
CodyG

|
Posted:
Wed Jun 03, 2009 11:56 am |
|
Oh nevermind. I found max_rss_items in nuke-blocks table. Maybe one day the variable will be in Add a Block. |
|
|
|
 |
fkelly

|
Posted:
Wed Jun 03, 2009 1:29 pm |
|
Not sure if posts are overlapping here timewise but as Jakec points out, your wishes have already been met CodyG. In add a block ... in other words admin ... blocks there is a field for maximum RSS items ... parenthetically it says "only for headlines". Just put your limit in there. ♠ |
|
|
|
 |
CodyG

|
Posted:
Wed Jun 03, 2009 7:42 pm |
|
hmmm.... I thought I'd already posted another reply. Oh well, next time I'm going to have another coffee before posting.
Thanks for your help.
 |
|
|
|
 |
|