Recent Topics

1 Nov 29, 2007 15:57    

I'm wondering if there is a way to set the main blob page up to only show posts from a single category (example: News), but still list all the other categories on the sidebar.

I guess waht I want is to make the default homepage of the blog essentially map to index.php?blog=1&cat=1 instead of index.php?blog=1

I looked through all of the options but couldn't find anything like that. I can do it through php if necessary but I'm hoping for a quick solution ;-)

Thanks!

2 Nov 29, 2007 16:46

What is the B2evo version of your blog?

3 Nov 29, 2007 19:05

Hi sorry, I thought I put that down.. 2.02 alpha 10/11/07

4 Jan 01, 2008 17:40

I am having trouble finding which PHP file I can change this in. Basically, if there is no cat= specified, i want to force cat=14 ... any ideas?

Also, I'd like to remove the "All" entry from the category list... possible?

thanks!

5 Jan 01, 2008 17:48

First of all this: The 2.0.1 version is beta and we have a more stable 2.3 version out. Please do upgrade as soon as possible and keep your blog updated in the near future. This shouldn't take much time.

To call the blog with a preset Category you want a stub file to control the flow. There is a pretty good section on that topic in the [url=http://manual.b2evolution.net/Stub_file]Wiki[/url], so read that first and return to the forum if you have subsequent questions.

Good luck

6 Jan 01, 2008 17:49

OK probably not the most elegant way of doing it, but I just added this to the bottom of _main_inc.php

if(!$_GET['cat'])
$_GET['cat'] = 14;

seems to work fine so far. we'll see how it does in the long run.

7 Jan 01, 2008 17:57

You'll throw loads of warnings in your logs if you do it like that

$cat  = ( empty( $_GET['cat' ] ) ? 14 : $_GET['cat'] );

¥

8 Jan 01, 2008 18:36

Thanks, I just missed your post. I'll check the wiki out now. My temp solution put warnings ont he login pages etc so i moved the code to _bloG_main_inc for now.

9 Jan 01, 2008 18:37

haha sorry yabba I just missed yours too. I need to get quicker on the refresh button before posting.

Thanks for the suggestions and I'll read up and try a few things out.

10 Jan 01, 2008 18:43

OK great, thanks for your help. I think I understand now, index.php is basically the default stub file, and you can set up certain parameters then just call the blog include php. So Yabba, I tried your code out near the bottom of index.php (before the include statement) and it seems to do exactly what I want. I took my hacks out of the inc files ;-)

Thanks both of you for your help!

11 Jan 01, 2008 19:35

OK I figured out how to remove "All" fro the list.

In:
\inc\widgets\widgets\_coll_category_list.widget.php

Replaced:


			'option_all' => array(
					'type' => 'text',
					'label' => T_('Option "All"'),
					'defaultvalue' => T_('All'),
					'maxlength' => 100,
					'note' => T_('The "All categories" link allows to reset the filter. Leave blank if you want no such option.'),
				),


With:


			'option_all' => '',


And it all seems OK now.
Thanks again!

12 Jan 02, 2008 00:28

you REALLY don't need to hack the core for that huh?

in your skins container call, just add 'option_all' => ''

¥

13 Jan 02, 2008 12:02

I like the way this is handled now via the Category widget...
Leave blank :)

14 Jan 02, 2008 14:44

Hm, I'm not sure what you mean by "Skins container call"

I found a problem with the forced category though... it seems like the search function now only searches category 14 and does not search any of the rest of the posts... is there a way to maintain search functionality across all posts and still only display cat 14 by default?

15 Jan 02, 2008 14:54

$cat  = ( empty( $_GET['cat' ] ) ? ( empty( $_GET['s'] ) ? 14 : '' ) : $_GET['cat'] );

¥

17 Jan 14, 2008 21:05

Hi all.. Im using version 1.10.2, and I got the same problem! I'm not really got at .php so can anybody please tell me what I need to change/do to only show posts from a single category ? (:


Form is loading...