Custom stuff...

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
daveg
Posts: 4
Joined: Fri Dec 12, 2003 11:41 am

Custom stuff...

Post by daveg »

Hi Guys,

Quick question...

How can I hack Serendipity so only posts from a certain category appear on the *front* page? Any code examples/pointers would be really helpful.

Cheers

Dave
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Open your index.php and add this after line #9 (in s9y v. 0.4, the line after $uri = $_SERVER[...]):

$serendipity['GET']['category'] = 'yourcategory';

This will set a default category. If one selected a different category, the variable gets changed later in index.php

Hope that does the trick,
Garvin.
Gecko

Post by Gecko »

Thanks a million for that code, works great.
joho
Regular
Posts: 54
Joined: Mon Oct 25, 2004 10:25 am
Location: Stockholm, Sweden
Contact:

Post by joho »

Perhaps this could be a configurable item sometime in the future?

"Initial view categories" or "Frontpage categories" or something like that?
At the end of a smile, there is a laugh and a 1/2 [DAD]
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

That's a good idea, thanks. I've added it to our todo list!

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