FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 38c46a47 authored by Chris Wilkinson's avatar Chris Wilkinson
Browse files

Merge pull request #15 from thewilkybarkid/focus-on-teaser

Set up Focus On teasers
parents de1a85f9 d5672d1d
No related branches found
No related tags found
No related merge requests found
...@@ -379,3 +379,12 @@ function cambridge_update_7103() { ...@@ -379,3 +379,12 @@ function cambridge_update_7103() {
field_update_instance($instance); 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() { ...@@ -143,7 +143,8 @@ function cambridge_base_install() {
'carousel' => 'carousel', 'carousel' => 'carousel',
'inline' => 'inline', 'inline' => 'inline',
'leading' => 'leading', 'leading' => 'leading',
'sidebar_teaser' => 'sidebar_teaser' 'sidebar_teaser' => 'sidebar_teaser',
'small' => 'small',
), ),
'max_filesize' => '', 'max_filesize' => '',
'max_resolution' => '', 'max_resolution' => '',
...@@ -192,6 +193,12 @@ function cambridge_base_install() { ...@@ -192,6 +193,12 @@ function cambridge_base_install() {
'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => 'content'), 'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => 'content'),
'weight' => -1, 'weight' => -1,
), ),
'focus_on_teaser' => array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => 'content'),
'weight' => -1,
),
), ),
), ),
array( array(
...@@ -210,7 +217,8 @@ function cambridge_base_install() { ...@@ -210,7 +217,8 @@ function cambridge_base_install() {
'carousel' => 'carousel', 'carousel' => 'carousel',
'inline' => 'inline', 'inline' => 'inline',
'leading' => 0, 'leading' => 0,
'sidebar_teaser' => 'sidebar_teaser' 'sidebar_teaser' => 'sidebar_teaser',
'small' => 'small',
), ),
'max_filesize' => '', 'max_filesize' => '',
'max_resolution' => '', 'max_resolution' => '',
...@@ -259,6 +267,12 @@ function cambridge_base_install() { ...@@ -259,6 +267,12 @@ function cambridge_base_install() {
'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => ''), 'settings' => array('image_style' => 'sidebar_teaser', 'image_link' => ''),
'weight' => -1, 'weight' => -1,
), ),
'focus_on_teaser' => array(
'label' => 'hidden',
'type' => 'image',
'settings' => array('image_style' => 'small', 'image_link' => ''),
'weight' => -1,
),
), ),
), ),
array( array(
...@@ -303,6 +317,11 @@ function cambridge_base_install() { ...@@ -303,6 +317,11 @@ function cambridge_base_install() {
'type' => 'link_default', 'type' => 'link_default',
'weight' => 1, '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) { ...@@ -569,3 +588,61 @@ function cambridge_base_install_configure_form_alter(&$form, $form_state) {
// Only check for updates, no need for email notifications. // Only check for updates, no need for email notifications.
$form['update_notifications']['update_status_module']['#default_value'] = array(1); $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() { ...@@ -17,3 +17,12 @@ function cambridge_lite_install() {
cambridge_base_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