5

I have multiple terms created and for each I have created direct links. However under the content this message is displayed (because there are no content linked to the node) :

There is currently no content classified with this term.

How to get rid of it ?

I don't like the CSS solution display:none.

3 Answers 3

7

A quick method is to edit the settings.php file, and add the following code:

$conf['locale_custom_strings_en'][''] = array(
  'There is currently no content classified with this term.' => '',
);

The settings.php file should already contains the code to populate the $conf['locale_custom_strings_en'] array at the bottom, but it should be commented out.

An alternative is to use the String Overrides module.

I would use the first method if you only need to modify one string, or few other strings. The pros are that you don't need to install another module, and only people who can alter the file on the site can alter the default strings. The cons are that it works only for English, and that is not possible to delegate the task (as requires access to the files on the web server).

In the other cases, including the case you are not comfortable with altering files on the server (or you cannot do it for many reasons), I would use the module. The module also works for other languages, as reported in the project page.

Locale support, allowing you to override strings in any language

2
  • The site has 3 languages. Is not possible to write something like locale_custom_strings_fr ?
    – EKK
    Commented Jun 16, 2011 at 13:01
  • @Ek Kosmos As far as I know, it is not possible. In that case, you should use the "String Overrides" module, which allows to change strings in any language.
    – avpaderno
    Commented Jun 16, 2011 at 13:37
9

Using mytheme_preprocess(&$variables, $hook) to override the $variables['page']['content']['system_main']['no_content'] variable.

function mytheme_preprocess(&$variables, $hook) {
  if(isset($variables['page']['content']['system_main']['no_content'])) {
    unset($variables['page']['content']['system_main']['no_content']);
  }
}
1

You can use hook_page_alter to alter those pages.

You could also create your own callback for the term page, which calls the one taxonomy use by default and then alter the output if no results are present.

hook_preprocess_page should also be useful to alter the output of the term pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.