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
  • 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/… Mar 17, 2013 at 15:44
  • Yes, would need to use the <!doctype html> - thank you.
    – 0skar
    Mar 17, 2013 at 17:52

3 Answers 3

7

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
  • 2
    great site builder resource there!
    – tenken
    Sep 8, 2014 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.

0

You can do this with a display suite custom wrapper.

Make sure you are using a display suite layout for the teaser view mode, and then select custom wrappers from the bottom left hand menu. Choose "link to content" from the "add link" drop down.

Your Answer

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

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