currently the target URL is displayed in one line. sometimes this target URL is long and it "disturbs" the format of the page.
can the target URLs span multiple lines?
thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | gotwo.127103-2.patch | 2.3 KB | spiderman |
| #3 | gotwo.127103.patch | 1.82 KB | spiderman |
Comments
Comment #1
BioALIEN commentedAs the 4.7.x branch has been dropped, I am moving this to 5.x as the issue is still valid.
Comment #2
spidermandefinitely a valid point- i've seen this one in my own testing, and it's a pain. i think a decent approach to this would be to wrap the link text in a call to wordwrap().
we could then give the admin control over the configurable parameters "width", "break" to define a maximum length of the text and what character to break it with (a space might be sufficient, in some cases). the "cut" flag might also be useful, to select mid-word character break.
if people agree with this approach, i definitely volunteer to roll a patch for this one :)
Comment #3
spidermanattached is a patch against the latest gotwo.module (1.5.2.3) which adds three admin settings for enabling word wrapping, setting wrap width, and selecting the character to wrap with (space or newline). the implementation in __gotwo_filter is then a few simple lines to call wordwrap() before writing out the final tag.
feedback on the general approach as well as the specifics of the patch are greatly appreciated :)
Comment #4
hass commentedWhy are we not using CSS here? Maybe we make the URL hidden and a mouse over will show the complete URL as tool tip.
Comment #5
BioALIEN commentedIMHO, wordwrap() introduces extra code for little gain. I think the tool tip idea is brilliant. Very simple and gets the job done. +1
Comment #6
hass commentedWe could also reuse this core function...
what ends in "http://www.example.com/verylongurl...".
Comment #7
BioALIEN commentedhass, that's a brilliant find. I feel stupid for not finding this sooner! Let's keep it consistent with core so +1 from me!
Comment #8
hass commented2 possible ways... make gotwo depend on statistics module and reuse the same function, or duplicate code... I think duplicating here gives us something more... not sure if everyone using gotwo like to activate statistics. :-)
Comment #9
BioALIEN commentedI am using statistics module. While its safe to assume whoever is interested in gotwo.module will also be interested in stats in general, due to the strain statistics.module places on the database, I don't think it's wise to make this module depend on it.
As a result, I think it's easier and more flexible to just duplicate the code. However, I still like the idea of showing the full URL as a tooltip in addition to using _statistics_link()
Comment #10
hass commentedComment #11
spidermanok i like the idea of using truncate_utf8() to allow for just shortening long urls, but i think the point of the original request was not to cut off the text, but just make it possible to wrap.
i've re-rolled this patch so the admin settings provide an option: either use wordwrap() to split long text up, or use truncate_utf8() to provide shortening of urls to a specified length. attached is the new patch for review. thoughts on this approach?
Comment #12
hass commentedFeel free to post a patch with a user friendly version, without any extra settings, for e.g. like #6, otherwise close at latest in 3 months.
Comment #13
hass commented