Hi all,

I have CCK, Contemplate, and views running in my Drupal 5 installation. I have a question.

I would like to remove the titles on some of my content pages, but not all of the others. For example, I want to remove the title from my podcast content page, but not my News, Blog, etc. pages.

I thought that I could create a node-content_podcast.tpl.php in the theme directory, and remove the title from it. It doesn't work. Is this what I should do? I have created a podcast template, but can't remove the title.

I am really new to Drupal and am working hard, but some of the stuff I just don't understand.

Thanks...Jamie

Comments

ivan zugec’s picture

So close, if you content name is podcast the node file name should be "node-podcast.tpl.php" not "node-content_podcast.tpl.php".
Just comment out this row:

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

Try that out.

--------------------------------------------------
http://www.usingdrupal.com
Tutorial Screencasts

jamiers’s picture

Ok... I am seriously confused. This worked on one installation of drupal and not another. I can remove these lines and it removes the date and submitted by user:

<!--  <?php if ($submitted): ?>
    <span class="submitted"><?php print t('!date â !username', array('!username' => theme('username', $node), '!date' => format_date($node->created))); ?>
  <?php endif; ?> -->

(which gets cut off her because my pico screen isn't wide enough, but ignore that)

But when I do this:

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

It doesn't remove the title.

Am I doing something wrong? If not, does anyone have any suggestions?

Thanks for helping out a noob.

Jamie

StevenSokulski’s picture

I believe the file should be named node-podcast.tpl.php.

mattdawson’s picture

...but if your thinking is anything like mine was (I'm also a noob), then you might find that creating a node-type specific node template file may not get rid of the title you're looking to eliminate.

If the title you're trying to remove is a page title and not a node title, the suggested technique won't work. In that case, you'll actually have to override the default page file instead, like page-podcast.tpl.php

If you're also using aliased URLs, there's some extra work you'll have to do to effect the correct page. Check out this link if you find yourself in that situation: http://drupal.org/node/117491

Let us know how it works out!

ryanoff’s picture

I am struggling to remove the node title of my CCK content type. I have themed the content type quite well using a node-myccktype.tpl.php but I still can't seem to get rid of the node title.

Matt, how would I know if it is in fact a page title I am struggling with? Any other thoughts on why the template file itself will not remove the title?