How do I get rid of the 'There are currently no posts in this category.' + XML icon ?

Because a situation I often have on my website is that I associate a page or a story with a certain taxonomy term, without adding further content to it as well.

You then get situations like this :

http://dreamgate.studentenweb.org/audio-dramas

How do I solve it and / or get rid of the 'There are currently no posts in this category.' + XML icon ?

I have found this question in another forum topic, but no one replied, so that's why I ask it here again ...

I would be very greatful !

Thanks !

Comments

rjung’s picture

What do you want the system to do when a user selects an empty category? Changing the "There are no posts" message is trivial -- open up the taxonomy.module and change the string.

Redirecting the user to a different URL is only slightly more complicated; just use a drupal_goto() to the URL desired.

--R.J.
http://www.electric-escape.net/

--R.J.

Catpriest’s picture

Redirecting won't be necessary, so i'll just edit the module

transformative’s picture

I believe that if you uncheck "Show message if no posts", in the "Category display settings" for the container, you will no longer receive that message.

Alternatively, you could comment out this line of code in the category.inc file:

    $output .= t('There are currently no posts in this category.');
darumaki’s picture

I get this message even when there is content in that category, when access is set by taxonomy access it just pretends there are no posts even though there are, i find this very odd behavior or it will show an empty article category even though article do exist. But now with books its different it properly displays the menu and when you click it says you do not have access but for other items it just makes it appear empty.

vm’s picture

enable the locale.module (part of core)
create a site specific language
find the strings in drupal you want to change.

documentation on doing this found here: HOWTO: Creating a customized language set to replace Drupal terminology

Doing it this way avoids updates or upgrades overwriting your changes to text strings.

Therefore you can find 'There are currently no posts in this category' and change it to 'You don't have permissions to see this forum'

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

darumaki’s picture

that tutorial is about changing language only, i tried the manage strings function in the module but it doesn't pull up anything

vm’s picture

Yes it is about changing language, and that is exactly what you are doing you are creating a site specific language rather then a spoken/written language variation.

anything wrapped in a t() can be changed with the locale.module. I've used it many many times to change specific strings in drupal that are wrapped in t().

My guess is you did not follow the instructions exactly as they are laid out and you should give it any go round.

After the empty site language is created you must follow the remainder of the instructions:

Now, any time you visit a page with Drupal hard-coded content, it will be added into your language set database. 

Once you have visited a page that you wish to change the content: 

1. Go to the manage strings page (admin/locale/string/search) of the localization section. 
2. Enter in the string you wish to search for. 
3. Edit the result and enter your replacement text. 

Thus you must visit pages after the site language is changed and this is what picks up the t() strings and allows you to change them in the manage strings area.

If you jump immediatley to manage strings without visiting any pages, it's no wonder that it was blank!

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

danbryant’s picture

The docs page you mentioned (http://drupal.org/node/24593) worked like a charm.

Thanks for the great tip ... Can't wait to mangle other t() stings!