Posted by stella on July 14, 2009 at 10:54pm
| 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
| Attachment | Size |
|---|---|
| link_views_field_link_title.patch | 974 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
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.
#3
Update: Sorry, Drupal thrown an error on me, patch in #2 leads nowhere, this one in #3 seems to be fine.
#4
Works well providing a new "Title, as plain text" field formatter appearing for both display fields and views
#5
Assigning to myself so I can find this faster.
#6
Okay, good job. I've added this to the link module and it will be in the next release.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.
#8
I needed this in 7.x version so rerolled and tested.
#9
hey wapnik
just what I needed - thanks!
#10
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
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
Automatically closed -- issue fixed for 2 weeks with no activity.