The title field of a view is trimmed to 40 characters, and the Title field is linked to it's content. Since the Title field text is trimmed I need to add title
attribute to the <a>
tag of the Title field and the content of the title
attribute must be the non-trimmed version of the Title field. So on mouseover event it should show the non-trimmed Title field text. How do I can do this?
I tried this
function THEME_preprocess_link(&$vars) {
// If title set and not empty dont do anything
if (isset($vars['options']['attributes']['title']) && !empty($vars['options']['attributes']['title'])) {
return;
}
// Use the link text as the title
$vars['options']['attributes']['title'] = strip_tags($vars['text']);
}
But it shows the trimmed version as the title
attribute.