Add field formatter 'URL, as link'.
gugrim - May 5, 2007 - 09:02
| Project: | Link |
| Version: | 5.x-2.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
In table views there is currently no way to have a column that shows the full url as a link. The attached patch adds such a formatter.
| Attachment | Size |
|---|---|
| link-formatter.patch | 850 bytes |

#1
Not sure why this issue wasn't ever closed, link module has supported "Plain, as text URL" since 2.0.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
#4
After upgrading to version 5.x-2.1 I found that this feature is still not available. Since I really need it I had to add my changes to the latest version. A new patch is attached.
#5
Changing version and status.
#6
Not sure why my comment and updated patch isn't shown. Trying again:
After upgrading to version 5.x-2.1 I found that this feature is still not available. Since I really need it I had to add my changes to the latest version. A new patch is attached.
#7
Ah, maybe a more appropriate label for the formatter would be "URL, as link" then? "Plain" indicates plain text, with no HTML.
#8
Absolutely, much better!
#9
+1 for replacing check_plain() in "plain" with
<?phpl(check_plain($item['url']), check_url($item['url']));
?>
I doubt that the current plain formatter is of any use for anyone. If someone needs such an useless formatter, then it can be implemented in a custom module.
#10
@sun:
l() already passes the $text to check_plain(). Thus, your code should be similar to
<?phpl($item['url'], check_url($item['url']));
?>
Updated patch attached.
#11
Breaking the current plain formatter is not a good option. I'm the one getting support requests ;)
The current plain formatter is quite helpful in many situations where you're parsing data and just want URLs, no wrapping tags.
#12
I renamed to "URL, as link" and ported a version for use in 6 as well. It'll be included in 2.2.
D5: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/link/link.mod...
D6: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/link/link.mod...
#13
Automatically closed -- issue fixed for two weeks with no activity.