Select a category

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
pavel
Regular
Posts: 9
Joined: Tue Oct 05, 2004 5:46 pm
Contact:

Select a category

Post by pavel »

I'm sorry to post here so many questions, but as I continue the discovery of s9y (that I've already adopted http://www.fosenbauer.com/blog) new questions arise.

I've created 2 categories : General & Photos. By default s9y shows both of them. Is it possible that by default it shows only one of the two categories and that my visitors must click on the "Photo" or the "All categories" link to see the other posts ? I didn't found such a config in the administrators panel.
(The only thing is that the visitors can themselves choose to see only one of the 2 categories, but I would like it to be a default setting).

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

Re: Select a category

Post by garvinhicking »

Well, such a default setting has never yet been wanted, so it's not implemented by default.

But actually, it's pretty easy. Just open your file serendipity_genpage.inc.php. Then adjust the following codeblock:

Code: Select all

include_once('serendipity_config.inc.php');
include_once(S9Y_INCLUDE_PATH . 'serendipity_plugin_api.php');
include_once(S9Y_INCLUDE_PATH . 'serendipity_sidebar_items.php');
if (!isset($serendipity['GET']['category'])) {
    $serendipity['GET']['category'] = 1;
}
include_once(serendipity_getTemplateFile('layout.php', 'serendipityPath'));
So, obviously you will set the category to '1' if none is selected by default. That will then affect the display of your blog, until a different category is selected.

Hope that helps,
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/
pavel
Regular
Posts: 9
Joined: Tue Oct 05, 2004 5:46 pm
Contact:

Post by pavel »

OK thanks, i'll try it !
Post Reply