0

I created a view listing some Articles, but displaying a custom field I added to the Article content type instead of the usually used title.

When I would display a title instead of the custom field, I could check the option to include a link together with the title. How can I do that with the custom field instead? It only offers me the option to display the custom field as a plain text, without the link checkbox.

4
  • You should find the option "Output this field as a link" under the "Rewrite Results" section of your custom field's configuration. – Stefanos Petrakis May 18 '16 at 8:10
  • I only see Output this field as a custom link, and that forces me to include a link address and I don't know what to type in there. – Ondrej May 18 '16 at 8:14
  • By custom field you mean a field you added on your own in the Article content type? Or a Views "Global: Custom Text" or similar? This is a Drupal 7 question, right? – Stefanos Petrakis May 18 '16 at 8:17
  • Yes, a field I added to the Article content type. Edited the question to include this. – Ondrej May 18 '16 at 8:24
2

Here is a configuration that should do what you need:

enter image description here

Hope this helps!

4
  • 1
    it's ugly to use /node/#, it's better to use aliases. To get the alias, you add Path as a field, and use the [path] token instead. That way you get /article/hello-world instead of /node/# as a link url. – No Sssweat May 18 '16 at 8:44
  • 1
    @NoSssweat: I would still use the node/# internally, i.e. for the link path, it's ugly but unambiguous and persistent. Additionaly, if there is an existing alias for that internal path, it's going to be automatically used by the outcoming URL handling of Drupal. The Path alias could be a good candidate for the title attribute of the link as well as for the Text of the link. – Stefanos Petrakis May 18 '16 at 8:47
  • @StefanosPetrakis lets agree to disagree. – No Sssweat May 18 '16 at 8:50
  • @NoSssweat: Sure :-) – Stefanos Petrakis May 18 '16 at 8:51

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.