FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit d5672d1d authored by thewilkybarkid's avatar thewilkybarkid
Browse files

Set up Focus On teasers

parent de1a85f9
No related branches found
No related tags found
1 merge request!15Set up Focus On teasers
......@@ -379,3 +379,12 @@ function cambridge_update_7103() {
field_update_instance($instance);
}
}
/**
* Set up Focus On teasers.
*/
function cambridge_update_7104() {
require_once 'cambridge_base.inc';
cambridge_base_set_up_focus_on_teasers();
}
......@@ -143,7 +143,8 @@ function cambridge_base_install() {
'carousel' => 'carousel',
'inline' => 'inline',
'leading' => 'leading',
'sidebar_teaser' => 'sidebar_teaser'
'sidebar_teaser' => 'sidebar_teaser',
'small' => 'small',
),
'max_filesize' => '',
'max_resolution' => '',
......@@ -192,6 +193,12 @@ function cambridge_base_install() {
'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => 'content'),
'weight' => -1,
),
'focus_on_teaser' => array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => 'content'),
'weight' => -1,
),
),
),
array(
......@@ -210,7 +217,8 @@ function cambridge_base_install() {
'carousel' => 'carousel',
'inline' => 'inline',
'leading' => 0,
'sidebar_teaser' => 'sidebar_teaser'
'sidebar_teaser' => 'sidebar_teaser',
'small' => 'small',
),
'max_filesize' => '',
'max_resolution' => '',
......@@ -259,6 +267,12 @@ function cambridge_base_install() {
'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => ''),
'weight' => -1,
),
'focus_on_teaser' => array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => ''),
'weight' => -1,
),
),
),
array(
......@@ -303,6 +317,11 @@ function cambridge_base_install() {
'type' => 'link_default',
'weight' => 1,
),
'focus_on_teaser' => array(
'label' => 'hidden',
'type' => 'link_default',
'weight' => 1,
),
),
),
);
......@@ -569,3 +588,61 @@ function cambridge_base_install_configure_form_alter(&$form, $form_state) {
// Only check for updates, no need for email notifications.
$form['update_notifications']['update_status_module']['#default_value'] = array(1);
}
/**
* Set up Focus On teasers.
*/
function cambridge_base_set_up_focus_on_teasers() {
if (FALSE === module_exists('cambridge_teasers')) {
return;
}
// Update Page's image field.
if (FALSE !== node_type_get_name('page') && NULL !== $instance = field_info_instance('node', 'field_image', 'page')) {
$instance['display']['focus_on_teaser'] = array_merge(
$instance['display']['focus_on_teaser'],
array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => 'content'),
'weight' => -1,
)
);
$instance['settings']['imagecrop']['small'] = 'small';
field_update_instance($instance);
}
// Update Link's image field.
if (FALSE !== node_type_get_name('link') && NULL !== $instance = field_info_instance('node', 'field_image', 'link')) {
$instance['display']['focus_on_teaser'] = array_merge(
$instance['display']['focus_on_teaser'],
array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => ''),
'weight' => -1,
)
);
$instance['settings']['imagecrop']['small'] = 'small';
field_update_instance($instance);
}
// Update Link's link field.
if (FALSE !== node_type_get_name('link') && NULL !== $instance = field_info_instance('node', 'field_link', 'link')) {
$instance['display']['focus_on_teaser'] = array_merge(
$instance['display']['focus_on_teaser'],
array(
'label' => 'hidden',
'type' => 'link_default',
'weight' => 1,
)
);
field_update_instance($instance);
}
}
......@@ -17,3 +17,12 @@ function cambridge_lite_install() {
cambridge_base_install();
}
/**
* Set up Focus On teasers.
*/
function cambridge_lite_update_7100() {
require_once 'cambridge_base.inc';
cambridge_base_set_up_focus_on_teasers();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment