I'd like to not have everything ever posted to my site be visible from the front page... only the most recent X items. I can not find where to set this.

If doing this requires hacking a module, I'm an experienced C++ programmer, but not so much at PHP. So if it's easy I'm still interested... however, I would like some advice on how these hacks interact with any future upgrades to the affected modules.

I'm using currently using drupal 4.6.0

Thanks

Mike

Comments

Madeye’s picture

Select the administer->content menu item. Click on the configure tab.

At the top of the resulting page there is an option Number of posts on main page. This can be used to set the maximum number of posts on the front page. It currently (4.6) allows 1-10,15,20,25,30. If you need a different number, the code for this page should provide a good starting point.

jamida’s picture

Thanks, but that wasn't quite my question.

I'm aware of that setting and it'd be great if I could also limit it to ONE page total.

All the content on my site is also shown in forum areas or image galleries, etc. So the front page is really just for the NEW stuff. So I don't need a rolling history that goes all the way back to the beginning of time on the front page.

I could do what I want by hand... I'd go into the content manager and uncheck "Promote to front page" on the older bits of content. But... is there a way to automate this?

sepeck’s picture

Create a node on the front page with php content and use the code snippets for a starting point for what you want.

http://drupal.org/node/23220
-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

jamida’s picture

That sounds perfect... thanks

Mike

Wes Cowley’s picture

Another option, if you don't mind tweaking code a bit. Go into node.module, find node_page_default() and comment out this line:

 $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));

That will only disable the pager on the front page.

jamida’s picture

Another excellent suggestion... I have a follow-up though...
if there was an update to drupal or node.module, how should I proceed? Is there a standard practice here? Left to my own devices I'll probably:
1) undo the change
2) apply the update
3) re-apply the change.

Thanks