When I use the trim-function the content disappears completely within that column of a table in Views, no matter to which length I try to trim. It works perfectly in the first column, but all the others turn out to be empty. I am not sure whether this is a bug, but I have configured all columns equally. Why don't they behave equally?

Comments

merlinofchaos’s picture

Category: bug » support
Priority: Critical » Normal

Trim can have an adverse affect on large markup, such as <img> tags or <a> tags with long hrefs. If the trim creates an invalid tag, this later gets cleaned up. Could this be part of the problem?

papricus’s picture

In fact all fields contain two nested <span>-tags each, except the first column which only contains a <span> and an <a>. I don't see the <span>'s really doing anything, but I would not know to get rid of them.

What do you mean by "this later gets cleaned up"?

PS: and thanks for the fast answer.

merlinofchaos’s picture

Status: Active » Closed (works as designed)

The corrector makes sure that tags that get sliced apart get removed since they become invalid. The shortener isn't smart enough to count characters after HTML rendering. YOu should try a longer character limit, but I have a feeling it is simply going to break if it tries to trim that anchor tag down.

merlinofchaos’s picture

You might also try the 'strip tags' option.