Recent Topics

1 Aug 12, 2006 11:05    

If you have a blog with subcategories and view the main category, on the top of the page all subcategories will be displayed. Example: http://www.antropologi.info/blog/anthropology/anthropology.php?cat=212

If you have lots of subcategories (as the case in a new planned blog), the list will get too long. Even this here doesn't look good: http://www.antropologi.info/blog/ethnologie/ethnologie.php?cat=161

Is it possible to exclude the subcategories to be displayed on the top of the page? I've searched the category- and css-files (and the forum) but couldn't find ways to change the display mode.

Thanks!

2 Aug 03, 2007 13:54

Are such kind of modifications possible in Florida? Any hacks? Thanks!

3 Aug 03, 2007 13:59

From the docs:

Advanced Use of Categories

It is possible to use one category across multiple blogs. This is called "cross posting". You can set category options like this by editing your conf/_admin.php file. The same parameter allows 4 options:

* only post in one category in one blog
* post in multiple categories in one blog
* post in multiple categories in multiple blogs
* move categories from one blog to a different blog

If this isn't enough, please report back to this topic.

In the upcoming version 2.0 the there are changes in the Categories setup is changed. In the [url=http://demo.b2evolution.net/?revision=HEAD&php_ver=php5&mysql_ver=mysql5]demo[/url] you can have a look. Version 2.0 is due in a few weeks time.

Good luck

4 Aug 03, 2007 15:13

Thanks for your answer, but my question was not about the display of posts or crossposting but about the lists of the categories on the top of the page (see example links in the first posts).

I only want to have displayed the main category and not the subcategories. For example on this page http://www.antropologi.info/blog/anthropology/anthropology.php?cat=208 the category heading should be "anthropology general" and not the subcategories ethics, fieldwork / methods, interdisciplinary, persons and theories, Visual Anthropology

It's for aethetic reasons. A new linkblog will have lots of subcategories. A long list of subcategories as heading won't look good

5 Aug 03, 2007 16:21

You could *cheat* ;)

<>php
			$Item->categories('view all posts in this category','<span style="font-weight:bold">','</span>','<span style="display:none">', '</span>');
?>

¥

*edit*

Oops, it'd help if I RTFQ'd :p

Back to the drawing board ;)

6 Aug 03, 2007 16:35

I'm sorry, I might sound stupid, but where should I put this? I looked in _main.php and _categories.php but am still confused... Thanks!

7 Aug 03, 2007 16:44

Fret not, it was the wrong answer anyway ;)

In your skins _main.php find a piece of code that looks like this :

	request_title( '<h2>', '</h2>' );

and replace it with this and see if it does what you expect :

if( empty( $cat ) )
{
	request_title( '<h2>', '</h2>' );
}
else
{
  $foo = get_the_category_by_ID( $cat );
  echo '<h2>'.$foo[ 'cat_name' ].'</h2>';
}

¥

8 Aug 03, 2007 16:55

Wow, cool! Thanks a lot! That's exactly what i wanted! :D

9 Jun 21, 2009 15:45

I have upgraded to 2.4.7 today and found out that this code produces an error when visiting the "user tool" and archive pages. Does anybody know a solution? Thanks for your help! (I only want the name of the main category displayed in the category view, not also the subcategories as well)

Here is the error message

An unexpected error has occured!

If this error persits, please report it to the administrator.

Go back to home page
Additional information about this error:
Output format [] not supported.


Form is loading...