5

how would I best wrap my entire node in an tag linking to the full node? My nodes are display using Display Suite and a custom view mode.

I'm guessing creating a php template and manually writing the link somehow would work?

  • 2
    One thing to note: what you are proposing is valid in HTML 5 but not in HTML 4 or earlier (assuming your node output includes div and other block level elements). Otherwise you can certainly do this with a custom template. This answer might help: drupal.stackexchange.com/questions/27025/… – Alfred Armstrong Mar 17 '13 at 15:44
  • Yes, would need to use the <!doctype html> - thank you. – Oskar Rough Mar 17 '13 at 17:52
6

A good option for this is Field Group Link.

For your case, basically you need to create a field group wrapping the whole node, and set the group type to 'Link'.

  • 1
    great site builder resource there! – tenken Sep 8 '14 at 23:07
1

When you go /admin/structure/types/manage/blog/display/teaser (or whatever content type you're going for) at the bottom is a list of possible template names. In my example ds-2col-stacked-fluid--node.tpl.php was what I needed.

In the template file I ended up wrapping my content variables with the following:

<a href="<?php echo url('node/' . $nid); ?>"> normal node here </a>

One thing to note is that you need to make sure there are no nested links around fields like image, author or title.

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.