array( 'title' => t('view full materiau description'), 'description' => t('view full materiau description'), ), ); } /** * Implements hook_preprocess(). */ function materio_display_preprocess_field(&$vars, $hook) { // dsm($vars); $element = $vars['element']; if($element['#field_name'] == 'field_description'){ // dsm($vars); if(!user_access('view full materiau description')){ $value = $element['#items'][0]['value']; switch ($element['#view_mode']) { case 'cardbig': case 'cardfull': $limit = 210; break; default: $limit = 130; break; } $summary = truncate_utf8($value, $limit, TRUE, TRUE); $summary .= '
' . t("In order to access full description, information about manufacturers and more, you need to upgrade your account.") . l(t("Pricing"), 'node/11187') . '