Removing the TITLE and TITLE LINK from front page only - pulling my hair out after 10 hours trying to get this to work!

McJustin - July 6, 2008 - 16:05

Hi all

I am having an absolute nightmare trying to do something that should seemingly be simple and straight forward.

http://i27.tinypic.com/zlq9vn.jpg

Above is a link to a picture. I want to remove the $title link from appearing on my home page, in order to simply create a splash page which will then link to various parts of the site.

Now.

1. I have attempted to rename the default path to home, and upload page-front.tpl.php to my themes folder (wabi theme)

2. I then tried renaming page-front.tpl.php to page-home.tpl.php and uploading to my themes folder.

3. I tried editing node.tpl.php and removing the title link, but this removes it from all pages, not just the page I want as my default home page.

I am now pulling my hair out and I'm completely frustrated that something so simple is proving to be ridiculously annoying.

In simple terms, (as if you were speaking to a child) please could someone put me out of my misery and explain what needs to be done.

Thank you so much in advance.

Is your front page the

nevets - July 6, 2008 - 16:11

Is your front page the default (normally a list of nodes) or have you set it to point to a single node?

I have tried both. Leaving

McJustin - July 6, 2008 - 16:19

I have tried both. Leaving my default front page as "node". Then changing my default front page as "home" and obviously making those changes to the actual page I'm using in URL settings. Then I tried pointing to a specific node "node/2" for example. Nada.

This worked for me

nevets - July 6, 2008 - 16:49

In node.tpl.php you will find something like (this is from garland, other themes may differ on how they print the title)

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


<?php if ($page == 0 && !$is_front): ?>
I changed the 'if' like this

so the titles no longer print on the front page.

You can also use $is_front in page.tpl.php. $is_front is true if viewing the front page, otherwise false.

:D

fiockthis - September 7, 2008 - 20:56

Awesome! You rock!

I added the && !$is_front to node.tpl.php in the Fresh Media theme, and the titles are now gone on my frontpage.

Thank you so much, I've been looking forever for this solution.

Do you have the 'views'

-Anti- - July 6, 2008 - 16:49

1)
Do you have the 'views' module installed?
You'll need it anyway further down the line (Views and CCK are 'must-have' modules for most drupal websites).
You could probably create a view of the node which didn't display the title (I'm about 80% sure).

2)
Also, the frontpage module might help: http://drupal.org/project/front
You could have separate css for your splash page, and therefore hide the title only on that page:

.node-title {display: none}

It might have other handy features you could use, too.

3)
Sorry, I don't know anything about 'themeing' it out.
You'd need to write a php statement: 'if the url is 'home' then load a css file (with the above over-ride in it)'.
I've no idea how or where you'd do that.

Cheers.

Thank you all for

McJustin - July 6, 2008 - 17:05

Thank you all for replying.

-Anti-. Point 2 (front page module) did the trick. Thank you so much!! I will also take a look at Views and CCK as possible alternatives.

Thank you all again.

tried and epic failed

klymaxx - November 18, 2008 - 22:52

so i did the changes as referenced in your post

<?php
if ($page == 0 && !is_front):
?>

and i recieve this error from browser:
Parse error syntax error, unexpected '&" in /home/user/public_html/ubercart/themes/garland/node.tpl.php on line 7

You're missing the $

kitt - November 18, 2008 - 23:04

There's a dollar sign in front of the is_front (or at least, there should be).

<?php
if ($page == 0 && !$is_front) :
?>

$is_front is a variable.

oh, this code totally

klymaxx - November 19, 2008 - 21:21

oh, this code totally removes the title for the post as well. What could i do to remove the links on the title of each post i make to the front page or any other pages?

Hello, Can someone please

neeshpal - April 21, 2009 - 15:17

Hello,

Can someone please help
I've given a page node as a default fontpage in administer--> site information. And I tried the above code change in node.tpl.php of bluenile theme but when I view the home page I still can see the title of the page.

Page titles are printed in

nevets - April 21, 2009 - 16:01

Page titles are printed in page.tpl.php, you would need similar logic in page.tpl.php where it prints the title. For bluenile replace

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

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

to hide the title on the front page.

Appreciate your reply. It

neeshpal - April 21, 2009 - 16:11

Appreciate your reply. It worked. Thanks a lot.

Bookmarking, greetings,

Summit - May 14, 2009 - 15:06

Bookmarking, greetings, Martijn
Could you also only not show node-title on certain other pages? Like not on taxonomy pages?
Edit: found this: http://drupal.org/node/117491 (need it on D6 :(
greetings,
Martijn

Greetings,
Martijn
if you appreciate e-development work, please place a link from your site to www.trekking-world.com

This doesn't work once I

fehin - June 25, 2009 - 21:32

This doesn't work once I logout. The title shows again for people not logged in.

 
 

Drupal is a registered trademark of Dries Buytaert.