0

I have a page having list of teasers populated using views for a certain content type. Now, I want the title of the teaser not to be a link to the original content/node. I want the title in same format but not to be a link. Please help if anybody know how to do it. I am using Drupal 7.

1

On the view you are using, simply click on the title field, and uncheck link field to original piece of content

enter image description here

  • 1
    Thanks for your answer @4life. But my view is not using any field. It is a teaser of content. – Nikhil Sep 6 '13 at 13:01
1

You can make it by override the node.tpl just go node.tpl.php in your theme and change this lines

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

To be

<?php if (!$page): ?>
    <h2<?php print $title_attributes; ?>>
     <?php print $title; ?>
    </h2>
  <?php endif; ?>
  • Thanks for your answer, but I think this code will change apply to every node. I want this option only for a particular content type. – Nikhil Sep 6 '13 at 18:15
  • 1
    you can override just one node using node--[content type].tpl.php example node--page.tpl.php or use if condition if(node->type=="page"){}else{} – Ahmed Sep 6 '13 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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