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.

CommentFileSizeAuthor
title-formatter.patch1.02 KBgugrim

Comments

quicksketch’s picture

Displaying the title as the link is the default view option. Am I missing something?

gugrim’s picture

Yes, 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'].

quicksketch’s picture

This 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.

gugrim’s picture

Tried the latest official version of CCK and it works without my patch. Thanks!

quicksketch’s picture

Status: Active » Fixed

Rock. thanks for the response :)

gugrim’s picture

Status: Fixed » Active

One 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.

quicksketch’s picture

Status: Active » Closed (fixed)

New issue open for the second request: http://drupal.org/node/141571.