Download & Extend

Expose link title in views, separate from link url

Project:Link
Version:7.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:jcfiala
Status:closed (fixed)
Issue tags:scheduled for beta1

Issue Summary

Currently it's possible to display the url of a cck link field in Views, but it's not possible to display the title, separate from the url. This might be needed in cases where you want to overwrite the output of the field, to alter things like the link target or class. Attached patch adds this feature.

Cheers,
Stella

AttachmentSize
link_views_field_link_title.patch974 bytes

Comments

#1

I would really like to see the ability for Link to output just the title.

Then you would be able to output title and URL as two separate fields in a view, and use Rewrite Output to do anything you want with their values right from the Views UI, no theming required.

A typical use case is when you DON'T want the title to actually be the link, you want it to just be a label with a "Click Here" link or something displayed underneath.

#2

Version:6.x-2.6» 6.x-2.x-dev
Category:feature request» task

I created a new formatter "Title, as plain text" which does just that - returns a plain text of the title (without surrounding tags), if empty - empty string. Can be used as a replacement pattern on other fields.

stella's approch is to expose a field only in Views. This approch is to make plain link title available everywhere where it's displayed - within Views or without.

AttachmentSize
link-519416.patch 1.24 KB

#3

Update: Sorry, Drupal thrown an error on me, patch in #2 leads nowhere, this one in #3 seems to be fine.

AttachmentSize
link-519416.patch 1.24 KB

#4

Status:needs review» reviewed & tested by the community

Works well providing a new "Title, as plain text" field formatter appearing for both display fields and views

#5

Assigned to:Anonymous» jcfiala

Assigning to myself so I can find this faster.

#6

Status:reviewed & tested by the community» fixed

Okay, good job. I've added this to the link module and it will be in the next release.

#7

Status:fixed» closed (fixed)

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

#8

Version:6.x-2.x-dev» 7.x-1.x-dev
Status:closed (fixed)» needs review

I needed this in 7.x version so rerolled and tested.

AttachmentSize
link-formatter_title_plain-519416.patch 1.17 KB

#9

hey wapnik

just what I needed - thanks!

#10

Status:needs review» needs work

Sadly, the patch no longer applies cleanly due to having had to prepend 'link' to all of the formatter names.

That being said, I can use it to guide building out the title formatter.

#11

Status:needs work» fixed

Okay, I made the change, added a test in LinkAttributeCrudTest to make sure it was working, and committed.

Should show up in the next version, or -dev soonish.

#12

jcfiala++

#13

marked 4 beta release

#14

Status:fixed» closed (fixed)

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

nobody click here