Is there an easy way to reduce the number of entries shown on each page - or even better, to archive all entries that are from the previous month.
Cheers
Ian
Number of entries per page.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Number of entries per page.
Serendipity 0.8 supports the configuration directive 'fetchLimit' to change that easily, how many posts are displayed.
In 0.7 you need to edit the layout.php file and adjust the number '15' to the amount of entries you want to display.
A blog usually always shows the last X entries and never only the ones for a month. If you want this, you'd need to hack certain things. See the $serendipity['range'] command and set it appropriately in index.php or your layout.php file to hardwire that always the actual month is shown if no range is set.
Regards,
Garvin.
In 0.7 you need to edit the layout.php file and adjust the number '15' to the amount of entries you want to display.
A blog usually always shows the last X entries and never only the ones for a month. If you want this, you'd need to hack certain things. See the $serendipity['range'] command and set it appropriately in index.php or your layout.php file to hardwire that always the actual month is shown if no range is set.
Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
That can still be a few weeks or even months away. But it's already quite usable, so you may just want to check it out 
But regarding replacing the '15' in your layout.php is also not that hard, so you can of course stick with 0.7 a little while longer
Regards,
Garvin
But regarding replacing the '15' in your layout.php is also not that hard, so you can of course stick with 0.7 a little while longer
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
devnet
not seeing where to change things in index.php
you say to change the range...I see no place to change it. That is, when looking for the word range...it appears about 20 times in index.php
So where does one set the range? I know it is an assigned value ($range) so where does one define this?
So where does one set the range? I know it is an assigned value ($range) so where does one define this?
layout.php
Also,
What layout.php file are we supposed to adjust if the theme used has its own layout.php? Do we adjust that one, the default directory, or both?
Just wondering on that.
What layout.php file are we supposed to adjust if the theme used has its own layout.php? Do we adjust that one, the default directory, or both?
Just wondering on that.
This is the bit of code you want to change:
Where I have the '10' is the number you change.
This is from my defaults theme, I assume that if you have a custom layout.php you will still have this in it (if you changed it you would know what it was anyway!)
Code: Select all
// The main area
switch ($serendipity['GET']['action']) {
// User wants to read the diary
case 'read':
if (isset($serendipity['GET']['id'])) {
serendipity_printEntries(array(serendipity_fetchEntry('id', $serendipity['GET']['id'])), 1);
} else {
serendipity_printEntries(serendipity_fetchEntries($serendipity['GET']['range'], true, 10));
}
break;
This is from my defaults theme, I assume that if you have a custom layout.php you will still have this in it (if you changed it you would know what it was anyway!)
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: not seeing where to change things in index.php
Hi Devnet!
You should also edit your layout.php, which would be the easiest way. There you can search for $serendipity['GET']['range'] and assign it, if it's empty...devnet wrote:you say to change the range...I see no place to change it. That is, when looking for the word range...it appears about 20 times in index.php
So where does one set the range? I know it is an assigned value ($range) so where does one define this?
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/