Classified Ad Module - Changing Title Text?

I'm using the Classified module as a simplified job advertisement system. See it here:

http://www.evacmod.net/?q=ed-classified

What I want to do is change the title text on this page from "Classifieds Ads" to "Position Ads".

I have already tried altering the following lines within the .module file:

<?php
drupal_set_title
('Job Ads');
?>

But this does not affect the main page of the Classifieds Ads module :(.

Any ideas?

Posted by: mikeuk2000 on Thu, 11/08/2007 at 2:33am

Use Drupal's localization module

Rather than alter the module source code, you should consider using the Drupal localization features, as described here:

http://drupal.org/node/24593

In the case you describe, I believe that the title is controlled by the hook_node_info callback:

<?php
function ed_classified_node_info() {
 
// beware: these must match nodeapi value; name must be same as $node->type for spam module to add spam reporting links
 
return array(EDI_CLASSIFIED_MODULE_NAME => 
               array(
'name' => t('Classified Ads'), // cannot call node_get_types() since it ends up calling this code.
                     
'module' => EDI_CLASSIFIED_MODULE_NAME,
                     
'description' => t('Contains a title, a body, and an administrator-defined expiration date')));
}
?>

It's best to use the localization module to alter the text, rather than modify the module sources, because you will need to migrate your customizations to any new release.

Mike – Thu, 11/08/2007 – 6:47am

I think the localizer module

I think the localizer module is used for developing multilingual content. But considering I only want to change a title on one page, I think it might be a little overkill. Essentially I'm looking for where this page reads/stores the page title "Classified Ads" and change it.

Does anyone know?

mikeuk2000 – Fri, 11/09/2007 – 12:29am

tweak ed_classified_node_info

The localization module is also used to alter text if you want to change some string without modifying a module.

See my previous reply for info about ed_classified_node_info which defines the text by Drupal.

Mike – Fri, 11/09/2007 – 8:57am

Same Problem, but...

Hello,

I've got the same Problem. I tried to use the localization to change the title on the ads classifieds index page. Localization cannot find the String. I don't know what i can do to solve the problem. I changed the title in the .module-file, but it doesn't work, too.

Is their another way?

Thanks,
Sebastian

Guest (not verified) – Tue, 12/04/2007 – 4:33pm

clear the cache

If you change the title in the module file, you need to clear out the cache tables for the change to appear:

http://drupal.org/node/17620

stephanie (not verified) – Sat, 02/02/2008 – 11:14pm

Post new comment

This helps us decide if you are a human, and not just some visiting bot.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h3> <h4> <br> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
More information about formatting options