In list views I have had the need for another formatter I chose to call 'title' (display name 'Title, as link'), that renders the link field as a link but displayed as the title.
The attached patch modifies the functions link_field_formatter_info and link_field_formatter to achieve this.
| Comment | File | Size | Author |
|---|---|---|---|
| title-formatter.patch | 1.02 KB | gugrim |
Comments
Comment #1
quicksketchDisplaying the title as the link is the default view option. Am I missing something?
Comment #2
gugrim commentedYes, sure that is the default but for some reason it doesn't work when a link field is used in a view from the Views module. If you add a link field in a view that you display as a table or list, then when link_field_formatter is invoked for the field, $item['title'] has the same value as $item['url'].
Comment #3
quicksketchThis is a known bug with CCK's view's implementation. Try upgrading to the latest official release (or possibly dev). I know it's been fixed but I can't find the issue at the moment.
Comment #4
gugrim commentedTried the latest official version of CCK and it works without my patch. Thanks!
Comment #5
quicksketchRock. thanks for the response :)
Comment #6
gugrim commentedOne step forward and one step back! Now I can't have a table column in a view that shows the URL as a link. I'll modify my modification to add a formatter 'Plain, as link' instead.
Comment #7
quicksketchNew issue open for the second request: http://drupal.org/node/141571.