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

PipSqueak’s picture

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?

dakku’s picture

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 } ?>
PipSqueak’s picture

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

dakku’s picture

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

PipSqueak’s picture

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

dakku’s picture

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

PipSqueak’s picture

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.

dakku’s picture

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

PipSqueak’s picture

It's weightlossfatbinder.com

Thanks very much.

dakku’s picture

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..

PipSqueak’s picture

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

subspaceeddy’s picture

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...

rlbravo’s picture

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

http://drupal.org/project/front

Hope it helps

PipSqueak’s picture

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?

elfboi’s picture

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.

PipSqueak’s picture

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

PipSqueak’s picture

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

spidersilk’s picture

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

megg’s picture

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; ?>
modul’s picture

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:

$somevariable = "";
drupal_set_title($somevariable);

Ludo

ryohio’s picture

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.

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
print $language->language " lang=" print $language->language " dir=" print $language->dir ">

print $head_title
print $head

body {behavior:url(" print $base_path . $directory /csshover.htc");}


print $styles

print $base_path . $directory /ie6.css" />
print $base_path . $directory /ie7.css" />

print $scripts

print $body_classes if($left_bar && !$right_bar){ echo ' leftbar_only';} elseif(!$left_bar && $right_bar){ echo ' rightbar_only';} elseif($left_bar && $right_bar){ echo ' twobars';} elseif(!$left_bar && !$right_bar){ echo ' nobars';}; ">

print $additional_header
print $breadcrumb;
if ($show_messages && $messages): print $messages; endif;
if ($mission): print '<div id="mission">'. $mission .'</div>'; endif;
print $top_content

print $help;
if ($tabs): print '<div id="tabs-wrapper" class="clear-block">'; endif;
if ($tabs): print '<ul class="tabs primary">'. $tabs .'</ul></div>'; endif;
if ($tabs2): print '<ul class="tabs secondary">'. $tabs2 .'</ul>'; endif;
if ($title): print '<h2'. ($tabs ? ' class="with-tabs"' : '') .'>'. $title .'</h2>'; endif;

print $content
print $bottom_content
print $left_bar
Design by TibiaFusion
if($search_box):

endif print $right_bar


simonwedege’s picture

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.