Commit 3021a0b2 authored by Philippe Mouchel's avatar Philippe Mouchel
Browse files

Use field_catchline instead of body to set summary

parent b09f0c05
......@@ -82,6 +82,9 @@ function _sharer_toolbar_generate_sharer_url(&$sharer_url, $variables) {
$sharer_url = str_replace('[:shared_source:]', variable_get('site_name', ''), $sharer_url);
// Summary replacement
$truncate_summary = truncate_utf8(drupal_html_to_text($variables['node']->body[LANGUAGE_NONE][0]['safe_value']), 200, TRUE, $add_ellipsis = TRUE);
$truncate_summary = '';
if (isset($variables['node']->field_catchline) && !empty($variables['node']->field_catchline)) {
$truncate_summary = truncate_utf8(drupal_html_to_text($variables['node']->field_catchline[LANGUAGE_NONE][0]['safe_value']), 200, TRUE, $add_ellipsis = TRUE);
}
$sharer_url = str_replace('[:shared_summary:]', $truncate_summary, $sharer_url);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment