I've spent some time searching the issue queue and the entire site for what should be something easy, but with no avail.

I have a simple view that displays nodes as "Row Style:Node" (not fields). I simply do not want the node titles in this view to link back to the original node. I've looked through the theme information and couldn't figure out what template code there I would need to use to achieve this and I couldn't find any options to turn off these links. Hopefully I'm just missing something easy and obvious.

Thanks for your help.

Comments

kriskd’s picture

I should add I made a copy of my node.tpl.php template file and named it node-view-recalls.tpl.php where recalls is the name of my view. I then removed the link code around the title variable, uploaded it to my theme directory and clicked the rescan template files button in Views and that did nothing to remove the title links in my View.

Once again, any help greatly appreciated.

kriskd’s picture

Status: Active » Closed (fixed)

Fixed. I didn't technically have the plain vanilla node.tpl.php in my sub-theme directory (it was in the parent). Once I put it in the sub-theme, everything worked.

xsoxso’s picture

I added print $title to the h2- Tags in my node.tpl.php (replacing the other stuff title_output($title, $node_url, $page)

laghalt’s picture

Title: Display Node Title WITHOUT Link Back to Node » A final fix

I was realy tired of this bug - as you in the views rows style options realy can chose "Display links" - with no affect on the output.

Accepting the bug and making it a useless option and manualy editing the node.tpl.php each time seems like wrong way to go - so i came up with a solution. It might not be a beutiful solution - but it means that you can edit the node.tpl.php file only without messing with the views module.

Just exchange the h2 title segment in node.tpl.php for this code:

       <?php
          if(isset($view)) {
            $current_display = $view->current_display;
            $link_title_to_node= $view->display[$current_display]->handler->handlers[filter][type]->view->display[$current_display]->handler->handlers[filter][type]->view->display[$current_display]->handler->handlers[filter][type]->view->display[$current_display]->handler->view->display[$current_display]->handler->default_display->options[row_options][links];
          }
        ?>
        <h2><?php if($link_title_to_node==1){
      print '<a href="' .  $node_url .'" title="'. $title . '">';
    }
   print $title;
   if($link_title_to_node==1){
       print '</a>';
   }

 ?></h2>

Then go to the view-page settings, go under row-style/node options and select "Display links" or not - as intended.