1

I created a custom node.tpl.php file with the following code:

<?php
 /**
  * @file
  * Default theme implementation to display a node.
  */
?>


<div<?php print $attributes; ?>>
  <?php print $user_picture; ?>

  <?php if ($display_submitted): ?>
    <div class="submitted">
      <?php print $submitted; ?>
    </div>
  <?php endif; ?>

  <?php print render($title_prefix); ?>
  <?php if (!$page && $title): ?>
    <h2<?php print $title_attributes; ?>><?php print render($title_link); ?></h2>
  <?php endif; ?>
  <?php print render($title_suffix); ?>

  <div<?php print $content_attributes; ?>>
    <?php
      hide($content['comments']);
      hide($content['links']);
      print render($content);
    ?>
  </div>

  <?php print render($content['links']); ?>
  <?php print render($content['comments']); ?>
</div>

Everything works, but the <h2> tags come with link I don't want.

Instead of <h2 datatype="" property="dc:title"><a href="/node/10">NEWSSSSS</a></h2>, I want <h2 datatype="" property="dc:title">NEWSSSSS</h2>.

How can I achieve this?

2
  • 1
    Sometimes asking a question helps you figure out the problem out, clears your thoughts. way to go
    – saadlulu
    Commented Oct 17, 2012 at 9:36
  • Remember to write an answer, when you can.
    – apaderno
    Commented Oct 17, 2012 at 15:22

1 Answer 1

1

I changed this line and worked!

<h2<?php print $title_attributes; ?>><?php print render($title_link); ?></h2>

change to

<h2<?php print $title_attributes; ?>><?php print render($title); ?></h2> 

($title_link) ----> ($title)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.