Page 1 of 1

Select a category

Posted: Fri Oct 08, 2004 3:53 pm
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 !

Re: Select a category

Posted: Fri Oct 08, 2004 4:18 pm
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.

Posted: Tue Oct 12, 2004 10:34 am
by pavel
OK thanks, i'll try it !