Added a link field via CCK and when trying to rewrite the title field in the view to output as a link it's trimming the link if it's too long. Currently working around the issue by manually rewriting the whole field rather than use Output this field as a link. It's as if the trim this field to a maximum length is checked but it's not for either the Title or the Link field (excluded from display)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | link-url-cutoff-setting.png | 15.89 KB | ethanw |
Comments
Comment #1
merlinofchaos commentedCan you give an example of what's being trimmed, how, and with what options in Views set?
Note that my first instinct is that this may be a problem with link.module poorly supporting the Views API. It may be building the link itself, rather than giving Views the link information. If that is the case, there's not much to be done about it except get link.module to change.
Comment #2
DaPooch commentedSure...
To replicate add a Link CCK field to a content type and enter a sufficiently long link (over 80 characters) In a view for the fields select Node Title and Content: Link. Reorder so the link field displays first and check "Exclude from display" On the Node title check the "Output this field as a link and use the replacement value for the link field. In my case: [field_link_url]
The node title itself displays fine, it's the link that's is being trimmed (the HREF value of the anchor) at what appears to be 80 characters and it ads an elipsis (...)
The only thing I have checked is "Output this field as a link" and I've put the replacement value in for [field_link_url]
If the value is less than 80 characters all appears to work correctly. Otherwise it's trimmed with elipsis. Display of the link field itself renders properly. Only when using it as a replacement value does it truncate. The "Use absolute path" and "External server URL" had no impact checked or unchecked problem persists.
Comment #3
domesticat commentedmerlin, I just spotted the same issue on our company intranet, which is running views 6.x-2.12. I'm using the Feeds module to pull the results of a Google news search into a feed_item node with the following fields:
I've built a simple list view, and wanted to do a fairly simple rewrite:
<a href="[field_url_value]">[title]</a>and realized the links were being truncated. Some interesting notes:Comment #4
domesticat commentedAha. I can confirm this is NOT a problem with Views. The clue was there all along -- in the formats! -- but I couldn't see it for what it was until I read #512544: External Links in Views page and link being truncated...
The problem is with your input filter. Go to admin -> site configuration -> input formats and then look at the Configure tab for each input filter that applies. There's an option under "URL Filter" that specifies a maximum text link length. By default it is 72. Make it bigger and your problem is solved.
Comment #5
williecoetzee commentedAlso if you are using the Realname module. Go to the realname settings. You need to change the maximum length of the username there as well if you are outputting names.
I realized this after I went to input formats and changed the lengths and nothing happened.
Comment #6
ethanw commentedI found this thread due to a similar issue. Tried #4 without luck, also disabled Pathogen and such in case those were culprits. No success with those, either.
Then did a quick grep/ack through the link module for "..." and found a line of code truncating based on the display settings for the field:
Looks like this issue is due to user error.
When retrieving the URL for display, the link module rightly applies the url cutoff setting, then we fold it back into the markup on rewrite.
To fix, edit the field settings on the offending content type and erase any value in the "URL DISPLAY CUTOFF" field. Image attached.
Comment #7
czigor commented#6 solved it for me (on Drupal 7.9), thanks!
Comment #8
kjrhody commentedCan someone please help me find this setting in Drupal 7? Having the same issue and don't know where to change it. Don't see it in the content type's field settings. Thanks