1

I have a custom view that lists a specific content type. I have fields output for each node and have set them to "Link to: Content".

Simply, is there a way to now set the target to "_blank"?

If you are "Rewriting Results" you have the option to specify the target attribute, however I am not rewriting the result (this requires a separate declaration of link path).

enter image description here

2 Answers 2

1

this requires a separate declaration of link path

If you are talking about node title it doesn't require a declaration of link path. Just leave this field empty and link will be made with default link path (e.g. node/NID).

For other fields you need to override link path. The easiest way is to add nid field and exclude it from display. Then you can use node/[nid] as link path. In this case you need not use link formatter in field settings.

5
  • Hey @Xio tried this checking "Rewrite the output of this field" and "Output this field as a link" and defining "target", however it doesn't apply _blank. Jul 29, 2013 at 3:28
  • What version of the Drupal are you using? It isn't required to check "Rewrite the output of this field" checkbox.
    – ya.teck
    Jul 29, 2013 at 4:47
  • Hey @Xio, using 7. Thanks for your help. Am I looking in the wrong place? I've attached a screenshot of the area. Target option only becomes available when I check "Output this field as a link" under rewrite results. Seems odd that I need to rewrite results when the field is already linked to Content. It also says "If checked, this field will be made into a link. The destination must be given below." Jul 29, 2013 at 10:41
  • I was thinking you are asking about node title. For other fields "Link path" is really required. I've updated the answer.
    – ya.teck
    Jul 29, 2013 at 11:23
  • Thanks @Xio. Might be worth adding to change dropdown "Link image to:" to "nothing". Else it appeared to interfere with the rewrite link. Jul 29, 2013 at 14:24
0

I think more comfortable approach is the answer "target=_blank for links in view"

  1. By using Linked Field module (or one other) and the teaser display in View (Show:Content | Teaser)

Using of the Linked Field module example

  1. By using and configuring fields in View module (not any content's display).

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.