I set a node as the front page, but drupal shows the title twice on the front page. How do I get rid of the title with link? Even better.. how do I remove both titles?

Comments

I removed this:

<?php print $breadcrumb ?>
<?php if ($title != ""): ?>
<div class="content<?php echo $layoutcode ?>-pagetitle"><?php print ($title) ?></div>
<?php endif; ?>

It only removed the header, but not the linked title of the node. Can anyone help please?

you could always add the below code to your page.tpl in your theme template:

<?php if (!drupal_is_front_page()) { ?>
        <h1 class="page_title"><?php print $title ?></h1>
<?php } ?>

Where do I put the code? with or without the codes I just removed? I want to remove all the titles of the node.

replace

<?php print $breadcrumb ?>
<?php if ($title != ""): ?>
<div class="content<?php echo $layoutcode ?>-pagetitle"><?php print ($title) ?></div>
<?php endif; ?>

with

<?php print $breadcrumb ?>
<?php if (!drupal_is_front_page()) { ?>
<div class="content<?php echo $layoutcode ?>-pagetitle"><?php print ($title) ?></div>
<?php } ?>

This code should go into your theme file called page.tpl.php, generally the location would be /drupal/themes/{your_theme}/page.tpl.php

I'm using multiflex theme. The link still doesn't go away after replacing that code.

can you post a bit more of your code buddy and indicate what file that code is in?

Here's the whole code from page.tpl.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">
  <head>
    <title><?php print $head_title ?></title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="Your description goes here" />
    <meta name="keywords" content="your,keywords,come,here" />
    <?php print $head ?>
    <?php print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_screen.css', 'screen');?>
    <?php print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_print.css', 'print');?>
<?php print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_override.css', 'all');?>
<?php print $styles ?>
  </head>
  <body<?php print theme("onload_attribute");?>>
    <div class="page-container-<?php echo $layoutcode ?>">
      <!-- HEADER -->
      <!-- Flag navigations -->
      <div class="navflag-container">
<div class="navflag">
</div>
      </div>
      <!-- Navigation Level 1-->
      <div class="nav1-container">
<div class="nav1">
  <?php if (is_array($secondary_links)) : ?>
  <ul>
    <?php foreach ($secondary_links as $link): ?>
    <li><?php print $link?></li>
    <?php endforeach; ?>
  </ul>
  <?php endif; ?>
</div>
      </div>
      <!-- Sitename -->
      <div class="site-name">
<?php if ($site_name) { ?><p class="title"><a href="<?php print $base_path ?>"><?php print $site_name ?></a></p><?php } ?>
      </div>
      <!-- Site slogan -->
      <div class="site-slogan-container">
<div class="site-slogan">
  <p class="text"><?php if ($site_slogan) { print($site_slogan); } // you could try class='title' or class='subtitle' for bigger text?>
  </p>
</div>
      </div>
      <!-- Header banner -->
      <div><img class="img-header" src="<?php print base_path() . path_to_theme() ?>/img/header.gif" alt=""/></div>
      <!-- Navigation Level 2-->
      <div class="nav2">
<?php if (is_array($primary_links)) : ?>
<ul>
  <?php foreach ($primary_links as $link): ?>
  <li> <?php print $link?> </li>
  <?php endforeach; ?>
</ul>
<?php endif; ?>
      </div>
      <!-- Buffer after header -->
      <div class="buffer"></div>
      <!-- Left block-->
      <?php if ($sidebar_left != ""): ?>
      <div class="mainnav">
<?php print $sidebar_left ?>
      </div>
      <?php endif; ?>
      <!-- CONTENT -->
      <div class="content<?php echo $layoutcode ?>">
<?php if ($mission) { ?><div id="mission"><h3><?php print $mission ?></h3></div><?php } ?>
<!-- Page title -->
<?php print $breadcrumb ?>
<?php if (!drupal_is_front_page()) { ?>
<div class="content<?php echo $layoutcode ?>-pagetitle"><?php print ($title) ?></div>
<?php } ?><?php if ($tabs) { ?>
<?php print ($tabs) ?>
<?php ; } ?>
<?php if ($help) { ?>
<div class="content<?php echo $layoutcode ?>-container line-box">
  <div class="content<?php echo $layoutcode ?>-container-1col">
    <div class="content-txtbox-shade bg-green02 txt-green10">
      <?php print ($help) ?>
    </div>
  </div>
</div>
<?php } ?>
<?php if ($messages) { ?>
<div class="content<?php echo $layoutcode ?>-container line-box">
  <div class="content<?php echo $layoutcode ?>-container-1col">
    <div class="content-txtbox-shade bg-yellow04">
      <?php print ($messages) ?>
    </div>
  </div>
</div>
<?php } ?>
<!-- Content -->
<div class="content<?php echo $layoutcode ?>-container">
  <?php print($content) ?>
</div>
      </div>
      <!-- SIDEBAR -->
      <?php if ($sidebar_right != ""): ?>
      <div class="sidebar">
<?php print $sidebar_right ?>
      </div>
      <?php endif; ?>
      <!-- FOOTER -->
      <div class="footer">
<?php if ($footer_message != ""): ?>
<p><?php print $footer_message ?></p>
<?php endif; ?>
<p>Based on a design by G. Wolfgang | <a href="http://validator.w3.org/check?uri=referer" title="Validate code as W3C XHTML 1.1 Strict Compliant">W3C XHTML 1.0</a> | <a href="http://jigsaw.w3.org/css-validator/" title="Validate Style Sheet as W3C CSS 2.0 Compliant">W3C CSS 2.0</a></p>
      </div>
    </div>
    <?php print $closure ?>
  </body>
</html>

When the node appears on the front page, there are two titles... one is text, the other is linked to the node itself. I managed to remove the text one, but the linked title won't go away.

Thanks for the code, on a quick glance it appears to be all there. any chance you can post the URL? since I am a "n00b" to drupal myself, the more ammo the better chance I have of being able to help you

It's weightlossfatbinder.com

Thanks very much.

ok mate, just checked your link. I just see:

"Weight Loss Fat Binder.com - Your Ultimate Resource for Weight Loss Products"

which part of that did you wanna trim? I didnt see no repeats..

Hi, I wanna take away the link. Notice that the "weight loss......... " is a link, I don't want it to link to the node. I'd rather just remove the title completely. Thanks

I think what you are looking for will be in the file 'node-tpl.php' in your template folder and will be a line something like

      <a href="<?php print $node_url ?>"><?php print $title ?></a>

although i'm not sure why you would want to do that. The site currently looks like you are using this post as the mission statement? if so, go to admin -> settings -> general and set it in there instead (using html markup) and leave nodes alone to do the job they are supposed to do.... but anyway, the above should help you with your current problem...

If you need to do so only in the frontpage i would suggest you frontpage.module

http://drupal.org/project/front

Hope it helps

I downloaded this module, but there's no option to remove linked title. The reason why I want to do this is that the full article is already shown on the page, why link to it again?

I'd like to use Multiflex, too, but all the node titles show up twice - once as a header with coloured background, then again as a link to the node itself, which is quite useless, since the node is already there. How can I just remove the link without removing the header?

Besides, is there some good documentation for Multiflex available, maybe even with some tutorials? I haven't found anything so far, just an example site...

http://finckendorff.dyndns.org/misc_media/som-site.png - this is what the site looks like with the Multiflex theme, I've switched back to NiftyDrupal now, because I can't use Multiflex the way it looks now. I want the coloured headers, but not the duplicate linked headers.

Looks like it's not just me who's having a problem with double titles, can anyone help please?

I'm also trying to figure out how to make the content area and blocks white. There are too many colours.

I'm using a heavily modified version of Multiflex, and the double titles thing was driving me crazy too.

Until I tried opening up the node.tpl file from another theme for comparison, and saw this:
<?php if ($page == 0) { ?><h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2><?php }; ?>
So I thought, Aha! And altered my node.tpl file as follows:

<?php if ($page == 0) { ?><p class="content-title-shade-size1 bg-blue07 box-on">&nbsp;</p>
    <p class="content-title-shade-size1 bg-blue03 txt-white"><?php print $title ?></p><?php }; ?>

With that in place, node titles only show up on multi-node pages.

You will also note another difference between what I just posted and the default Multiflex node.tpl file: I had earlier removed the link tags around the title. If having all the titles show up pale grey and underlined annoys you as much as me, it's just a matter of taking away the "a href..." tag that surrounds the title. People can click on the "Read More" link if you're using teasers, and if you're not, then they're already seeing the full node and clicking on the title wouldn't get them anywhere anyway, so I figured the linked titles were kind of useless.

Lynna

Business: http://www.spidersilk.net
Personal: http://www.wildideas.net

a variation on spidersilk's fix worked for me, too. :)

in node.tpl.php (theme based on garland), i changed this:

<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

to this:

<?php if ($page == 0): ?>
  <h2><?php print $title ?></h2>
<?php endif; ?>

I didn't read this whole thread, but getting rid of a title (or setting a title, for that matter) should work with drupal_set_title to nothing:

<?php
$somevariable
= "";
drupal_set_title($somevariable);
?>

Ludo

i wanted to remove the Welcome:

please visit this site: www.wilsonng.net/balikmandaue... im using Bluesquare template.

this is the complete code. please help me remove the page title on the header. thanks.

<?php
print $head_title
?>

<?php
print $head
?>

body {behavior:url("

<?php
print $base_path . $directory
?>
/csshover.htc");}

<?php
print $styles
?>

<?php
print $scripts
?>

<?php
print $header_banner
?>

<?php
if($logo):
?>
<?php
print $frontpage
?>
" rel="nofollow">Only local images are allowed.<?php
print $logo
?>
" />
<?php
endif
?>
<?php
if($site_name):
?>
<?php
print $site_name
?>
<?php
endif
?>
<?php
if($site_slogan):
?>
<?php
print $site_slogan
?>
<?php
endif
?>

<?php
if($header_banner){ echo '<div class="clean_float"></div>';};
?>

<?php
print $additional_header
?>

<?php
print $breadcrumb;
?>

<?php
if ($show_messages && $messages): print $messages; endif;
?>

<?php
if ($mission): print '<div id="mission">'. $mission .'</div>'; endif;
?>

<?php
print $top_content
?>

<?php
print $help;
?>

<?php
if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif;
?>

<?php
if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif;
?>

<?php
if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif;
?>

<?php
if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif;
?>

<?php
print $content
?>

<?php
print $bottom_content
?>

<?php
print $left_bar
?>
Design by TibiaFusion
<?php
if($search_box):
?>
<?php
print $search_box
?>
<?php
endif
?>
<?php
print $right_bar
?>

<?php
print $footer
?>

<?php
print $footer_message
?>

<?php
print $closure
?>

The module Panels is a good way to remove titles, without changing the theme code itself. Then you can control which content types should have titles and which shouldn't have titles.