FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-cambridge-profile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Information Services
DevOps
Drupal team
drupal-cambridge-profile
Commits
d5672d1d
Commit
d5672d1d
authored
10 years ago
by
thewilkybarkid
Browse files
Options
Downloads
Patches
Plain Diff
Set up Focus On teasers
parent
de1a85f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
Set up Focus On teasers
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cambridge/cambridge.install
+9
-0
9 additions, 0 deletions
src/cambridge/cambridge.install
src/cambridge_base.inc
+79
-2
79 additions, 2 deletions
src/cambridge_base.inc
src/cambridge_lite/cambridge_lite.install
+9
-0
9 additions, 0 deletions
src/cambridge_lite/cambridge_lite.install
with
97 additions
and
2 deletions
src/cambridge/cambridge.install
+
9
−
0
View file @
d5672d1d
...
...
@@ -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
();
}
This diff is collapsed.
Click to expand it.
src/cambridge_base.inc
+
79
−
2
View file @
d5672d1d
...
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
src/cambridge_lite/cambridge_lite.install
+
9
−
0
View file @
d5672d1d
...
...
@@ -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
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment