I created a page and published to front page. The title (h2) is a link??? When I click on the link, it displays the same page but at
address (node/2). Why is the homepage title a link and how to remove it? I am using the amadou theme.

Comments

snsace’s picture

Any ideas on this. Again, why does my homepage title link to itself?

markuseriksson’s picture

Hi! I am new to Drupal but quite at home with themes and html/css, so some Drupal veteran might show up and correct me on this.
Anyhow, here goes my solution (I have used the garland theme to play around with to get to know Drupal so this worked for that theme, maybe for others):
1. In your favorite html-editor open themes/garland/node.tpl.php
2. On line 9 it says:

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

3. Change that so it says just:

<h2><?php print $title ?></h2>

4. Upload to node.tpl.php to the correct place on your server
5. Done! Link should be bye bye gone!
Note: this removes the link for all pages, not just the frontpage. I am sure you can create some sort of if statement in php if you want different things on front and other pages. Have not gotten that far with Drupal yet so somebody else might help you with that.
Good luck!

markuseriksson’s picture

Hi again, after posting I saw that you were using Amadou theme. Since I dont like not finishing things I get myself into (good trait sometimes, pain in the rear end some times) I had a look at Amadou.
Note: I have not actually installed it (had to draw the line somewhere), just looked at node.tpl.php (which I by now figure is a standard file in Drupal themes).
So in that very file starting on line 5 it says:

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

Change this to:

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

And you should be set. Note I have not tried it live, so give it a shot and let me know how you go.
PS: To find the file to edit the path to file would most likely be themes/amadou/node.tpl.php.

snsace’s picture

Thank you markuseriksson for the help. Before I had a chance to try your suggestion, I found another workaround for my problem.
The title link was only on my homepage . Instead of promoting my home page node to "front", I just published
it and set the homepage path to (node/2) in site information. This now makes my homepage work
like any other node...where the head title is static.

bazzab’s picture

Hi Both,

I am new to this also but have found the correct way to remove the home link.

The file that needs to be amended is the correct name but in the following location:-
/modules/node/node.tpl.php

FROM:

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

TO:

<?php if (!$page): ?>

<?php endif; ?>

Beware:
Removing this will remove the home link for every theme.