Hiding a Node Title for homepage.

bswonetz - April 25, 2009 - 23:21

I am trying to hide the title on a specific page that I have used for my homepage. I have looked at many different posts, but nothing has worked thus far. Right now I have named the page with a ".", but I would like to get it out of there completely.

I am using superclean theme with drupal 6.

Here is a link:

http://www.annabeejewelry.com

thanks, bswonetz

=-=

VM - April 25, 2009 - 23:26

create a custom page-front.tpl.php and remove the title variable or investigate the auto_nodetitle.module

An alternative approach

nevets - April 26, 2009 - 02:10

You can add logic that uses $is_front and skip printing the title when true, something like

<?php  if ( !$is_front  && $title )   :  ?>
<h2><?php print $title?></h2>
<?php endif;  ?>

an alternative approach?

bswonetz - April 27, 2009 - 17:38

Hi Nevets,

I am on to learning PHP right now, so not to skilled in where on the page to insert this. I have tried to insert it into the bottom of the body section here:

<div id="body-section<?php if(!$left AND !$logo) {print '-wide';} ?>">
            <?php print $tabs ?>
            <?php print $messages ?>
            <?php if($content_top) { ?>
                <div id="content-top"><?php print $content_top ?></div>
            <?php } ?>
            <h1 id="page-title"><?php print $title ?></h1>
            <?php print $help ?>
            <?php print $content ?>
        </div>
       
        <?php  if ( !$is_front  && $title )   :  ?>
<h2><?php print $title?></h2>
<?php endif;  ?>
<!--END BODY-SECTION-->

Does it need to be inside the div section? Or not in that area at all? It doesn't work where I have put it, so...

Thanks, Clueless

Something like this should be

gbrussel - April 27, 2009 - 17:46

Something like this should be the ticket:

<div id="body-section<?php if(!$left AND !$logo) {print '-wide';} ?>">
            <?php print $tabs ?>
            <?php print $messages ?>
            <?php if($content_top) { ?>
                <div id="content-top"><?php print $content_top ?></div>
            <?php } ?>
            <?php if (!$is_front && $title): ?><h1 id="page-title"><?php print $title ?></h1><?php endif; ?>
            <?php print $help ?>
            <?php print $content ?>
        </div>
<!--END BODY-SECTION-->

Thanks gbrussel!

bswonetz - April 27, 2009 - 18:11

Thanks a lot! That worked flawlessly.

Best, Brad

May I know where can I find this script?

DLZJ - May 22, 2009 - 06:58

I plan to hide the title page from being viewed as well. But I do not know where exactly the particular script you were saying.

<div id="body-section<?php if(!$left AND !$logo) {print '-wide';} ?>">
            <?php print $tabs ?>
            <?php print $messages ?>
            <?php if($content_top) { ?>
                <div id="content-top"><?php print $content_top ?></div>
            <?php } ?>
            <?php if (!$is_front && $title): ?><h1 id="page-title"><?php print $title ?></h1><?php endif; ?>
            <?php print $help ?>
            <?php print $content ?>
        </div>
<!--END BODY-SECTION-->

May I know where can I find this script and what's the name?
*I am using clearblue theme.
Thanks

page.tpl.php

gbrussel - May 22, 2009 - 13:16

It should be in the page template file.

 
 

Drupal is a registered trademark of Dries Buytaert.