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.

AttachmentSize
link-formatter.patch850 bytes

#1

quicksketch - October 21, 2007 - 05:46
Status:active» fixed

Not sure why this issue wasn't ever closed, link module has supported "Plain, as text URL" since 2.0.

#2

Anonymous - November 12, 2007 - 22:41
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#3

Benjamin Melançon - March 12, 2008 - 15:53
  1. If you look at the patch, the author's intention is to have a linked URL, which is not yet an option (see image)
  2. The output is not truly plain, in any case. New issue opened: http://drupal.org/node/233304
AttachmentSize
link-field-display-options.png 14.79 KB

#4

gugrim - May 19, 2008 - 15:31

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.

AttachmentSize
link-formatter.patch 914 bytes

#5

gugrim - May 19, 2008 - 15:58
Version:5.x-1.5» 5.x-2.1
Status:closed» active

Changing version and status.

#6

gugrim - May 19, 2008 - 16:05

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.

AttachmentSize
link-formatter.patch 914 bytes

#7

quicksketch - May 19, 2008 - 18:14

Ah, maybe a more appropriate label for the formatter would be "URL, as link" then? "Plain" indicates plain text, with no HTML.

#8

gugrim - May 20, 2008 - 11:52

Absolutely, much better!

#9

sun - June 3, 2008 - 17:25
Status:active» needs review

+1 for replacing check_plain() in "plain" with

<?php
l
(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.

AttachmentSize
link-DRUPAL-5.plain_.patch 761 bytes

#10

smk-ka - June 3, 2008 - 18:36

@sun:
l() already passes the $text to check_plain(). Thus, your code should be similar to

<?php
l
($item['url'], check_url($item['url']));
?>

Updated patch attached.

AttachmentSize
link-DRUPAL-5.plain_.patch 748 bytes

#11

quicksketch - June 4, 2008 - 06:20

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

quicksketch - June 6, 2008 - 03:58
Title:Add field formatter 'Plain, as link'.» Add field formatter 'URL, as link'.
Status:needs review» fixed

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

Anonymous (not verified) - June 20, 2008 - 04:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.