Commit d89b4539 authored by jurgenhaas's avatar jurgenhaas

Issue #2860231 by brockfanning: Add options for controlling the "rel"...

Issue #2860231 by brockfanning: Add options for controlling the "rel" attribute for Colorbox grouping
parent 8c09b321
......@@ -23,6 +23,7 @@ function colorbox_field_formatter_field_formatter_info() {
'colorbox_field_formatter_iframe' => 0,
'colorbox_field_formatter_anchor' => '',
'colorbox_field_formatter_class' => '',
'colorbox_field_formatter_rel' => '',
),
),
);
......@@ -154,6 +155,12 @@ function colorbox_field_formatter_field_formatter_settings_form($field, $instanc
'#type' => 'textfield',
'#default_value' => $settings['colorbox_field_formatter_class'],
);
$element['colorbox_field_formatter_rel'] = array(
'#title' => t('Rel'),
'#type' => 'textfield',
'#default_value' => empty($settings['colorbox_field_formatter_rel']) ? '' : $settings['colorbox_field_formatter_rel'],
'#description' => t('This can be used to identify a group for Colorbox to cycle through.'),
);
return $element;
}
......@@ -283,6 +290,9 @@ function colorbox_field_formatter_field_formatter_view($entity_type, $entity, $f
if (!empty($settings['colorbox_field_formatter_class'])) {
$options['attributes']['class'] = array_merge($options['attributes']['class'], explode(' ', $settings['colorbox_field_formatter_class']));
}
if (!empty($settings['colorbox_field_formatter_rel'])) {
$options['attributes']['rel'] = $settings['colorbox_field_formatter_rel'];
}
$output = l($output, $uri['path'], $options);
......
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