Remove your site titles from content pages in Drupal

Tagged:  

In Drupal (considering v5.x here), the content page titles i.e. the text which is generated and put between <TITLE> HTML tag comes like this -

Content-Name | Site Name

Right ?

This doesn't look nice and it is not possible to remove this by editing a theme's file.

So here's a simple code change about how to remove this title internally so that whenever it is generated, it gets generated as

Content-Name

We're considering the default template engine - PHPTemplate which comes with Drupal.

You need to edit the file called phptemplate.engine file in /themes/engines/phptemplate directory.

Open the file your favourite editor.

Jump to Line 185 (As of Drupal 5.x)

$head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));

Change the above line so that it looks like this -

$head_title = array(strip_tags(drupal_get_title()));

Save the file.

And copy this new file to /themes/engines/phptemplate/phptemplate.engine while backing up the older file.

And voila! you are done!

Trackback URL for this post:

http://www.itech7.com/trackback/98

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Good finding!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h1><h2><h3><h4><h5><h6><b><i><u><style><div><span><li><ol><ul><img><s><em><strong><a><address><blockquote><table><td><tr><th><caption><p><br><pre><code><fn><footnotes><dl><dt><dd><font>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.

More information about formatting options

CAPTCHA
This is to verify that you are human visitor
3 + 16 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Syndicate content
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the Poster. Rest Copyright © iTech7.com

For License and Copyrights see http://www.itech7.com/Content-Copyrights