Commit 947d04eb authored by Michael R Lupi's avatar Michael R Lupi
Browse files

Initial commit of project repository

parents
Tufts Alerts
==========
Tufts Alerts allows site editors to create alert banners with urgent or marketing messages. It installs two
content types: Emergency Alert and Marketing Alert.
The Emergency Alert allows for up to 3 levels of alert (high, medium, low) with corresponding red, yellow
and gray backgrounds.
The Marketing Alert allows for the selection of a background color, alert text and a
required call-to-action button.
In both content types, site editors specify the path(s) where the alert banners should appear. Editors
should be mindful of not placing more than 1 banner of each type on a path/page since only 1 banner of
that type (the most recently updated one) will actually appear.
Installation
===================
1) Install and enable the module
2) Set permissions on roles allowed to create/edit/delete node types Marketing Alert and Emergency Alert
3) Place the blocks "Tufts Emergency Alert block" and "Tufts Marketing Alert block" in the theme regions where you want the blocks to display.
Do not place any visibility restrictions on the blocks since paths are set at the node level.
4) Create node instances of Marketing Alert and/or Emergency Alert as needed. Be sure to specify appropriate paths and publish the node for it to appear.
Theming
==============
The module provides two block (wrapper) templates and two node templates in templates/:
tufts-emergency-alert.html.twig
node--emergency-alert.html.twig
tufts-marketing-alert.html.twig
node--marketing-alert.html.twig
Copy these to your theme if you need to override them.
The module also provides default stylesheets in css/:
emergency-alert.css
marketing-alert.css
Copy these to your theme to override them. IMPORTANT: please limit style changes to small adjustments to better fit the alerts
to your theme. Keep the background colors, button styles, font styles, etc. intact. These are styles set by University Communications and
Marketing for brand compliance.
{
"name": "digiserve_public/tufts_alerts",
"description": "Displays emergency and marketing alert banners",
"type": "drupal-custom-module",
"authors": [
{
"name": "Mike Lupi",
"email": "mike.lupi@tufts.edu"
}
],
"minimum-stability": "dev",
"require": {}
}
langcode: en
status: true
dependencies:
config:
- node.type.emergency_alert
id: node.emergency_alert.promote
field_name: promote
entity_type: node
bundle: emergency_alert
label: 'Promoted to front page'
description: ''
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
langcode: en
status: true
dependencies:
config:
- node.type.emergency_alert
id: node.emergency_alert.status
field_name: status
entity_type: node
bundle: emergency_alert
label: Published
description: ''
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
langcode: en
status: true
dependencies:
config:
- node.type.emergency_alert
id: node.emergency_alert.title
field_name: title
entity_type: node
bundle: emergency_alert
label: 'Title (internal use only)'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
langcode: en
status: true
dependencies:
config:
- node.type.marketing_alert
id: node.marketing_alert.promote
field_name: promote
entity_type: node
bundle: marketing_alert
label: 'Promoted to front page'
description: ''
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
langcode: en
status: true
dependencies:
config:
- node.type.marketing_alert
id: node.marketing_alert.status
field_name: status
entity_type: node
bundle: marketing_alert
label: Published
description: ''
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
langcode: en
status: true
dependencies:
config:
- node.type.marketing_alert
id: node.marketing_alert.title
field_name: title
entity_type: node
bundle: marketing_alert
label: 'Title (internal use only)'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
langcode: en
status: true
dependencies:
config:
- field.field.node.emergency_alert.field_alert_level
- field.field.node.emergency_alert.field_alert_paths
- field.field.node.emergency_alert.field_alert_text
- field.field.node.emergency_alert.field_noalert_paths
- node.type.emergency_alert
module:
- path
- text
_core:
default_config_hash: Dft29-P71myLXHqOV4CmtqJ72HJqKb5v2t-pVi5HpN4
id: node.emergency_alert.default
targetEntityType: node
bundle: emergency_alert
mode: default
content:
created:
type: datetime_timestamp
weight: 6
region: content
settings: { }
third_party_settings: { }
field_alert_level:
weight: 1
settings: { }
third_party_settings: { }
type: options_select
region: content
field_alert_paths:
weight: 3
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
field_alert_text:
weight: 2
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: text_textarea
region: content
field_noalert_paths:
weight: 4
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
path:
type: path
weight: 9
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 7
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 10
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 8
region: content
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 5
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
match_limit: 10
region: content
third_party_settings: { }
url_redirects:
weight: 9
region: content
settings: { }
third_party_settings: { }
hidden: { }
langcode: en
status: true
dependencies:
config:
- field.field.node.marketing_alert.field_alert_background_color
- field.field.node.marketing_alert.field_alert_cta
- field.field.node.marketing_alert.field_alert_paths
- field.field.node.marketing_alert.field_alert_text
- field.field.node.marketing_alert.field_noalert_paths
- node.type.marketing_alert
module:
- link
- path
- text
_core:
default_config_hash: r15FjSKGfqweV8_9shugx--HvuBZqgPli_drOL5ZBt8
id: node.marketing_alert.default
targetEntityType: node
bundle: marketing_alert
mode: default
content:
created:
type: datetime_timestamp
weight: 7
region: content
settings: { }
third_party_settings: { }
field_alert_background_color:
weight: 1
settings: { }
third_party_settings: { }
type: options_select
region: content
field_alert_cta:
weight: 3
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
type: link_default
region: content
field_alert_paths:
weight: 4
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
field_alert_text:
weight: 2
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: text_textarea
region: content
field_noalert_paths:
weight: 5
settings:
rows: 5
placeholder: ''
third_party_settings: { }
type: string_textarea
region: content
path:
type: path
weight: 10
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
settings:
display_label: true
weight: 8
region: content
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 11
region: content
third_party_settings: { }
sticky:
type: boolean_checkbox
settings:
display_label: true
weight: 9
region: content
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 6
settings:
match_operator: CONTAINS
size: 60
placeholder: ''
match_limit: 10
region: content
third_party_settings: { }
url_redirects:
weight: 10
region: content
settings: { }
third_party_settings: { }
hidden: { }
langcode: en
status: true
dependencies:
config:
- field.field.node.emergency_alert.field_alert_level
- field.field.node.emergency_alert.field_alert_paths
- field.field.node.emergency_alert.field_alert_text
- field.field.node.emergency_alert.field_noalert_paths
- node.type.emergency_alert
module:
- text
- user
_core:
default_config_hash: XwVDB8DJpilN4EMr8VKmrSVWYx5sft4w6DcFs5HA7GU
id: node.emergency_alert.default
targetEntityType: node
bundle: emergency_alert
mode: default
content:
field_alert_text:
weight: 0
label: hidden
settings: { }
third_party_settings: { }
type: text_default
region: content
hidden:
field_alert_level: true
field_alert_paths: true
field_noalert_paths: true
links: true
search_api_excerpt: true
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.emergency_alert.field_alert_level
- field.field.node.emergency_alert.field_alert_paths
- field.field.node.emergency_alert.field_alert_text
- field.field.node.emergency_alert.field_noalert_paths
- node.type.emergency_alert
module:
- user
_core:
default_config_hash: 6IAEEdzyeORRarVcHvDd2KJj2RCD7JES0xXapUIE1as
id: node.emergency_alert.teaser
targetEntityType: node
bundle: emergency_alert
mode: teaser
content:
links:
weight: 100
settings: { }
third_party_settings: { }
region: content
hidden:
field_alert_level: true
field_alert_paths: true
field_alert_text: true
field_noalert_paths: true
search_api_excerpt: true
langcode: en
status: true
dependencies:
config:
- field.field.node.marketing_alert.field_alert_background_color
- field.field.node.marketing_alert.field_alert_cta
- field.field.node.marketing_alert.field_alert_paths
- field.field.node.marketing_alert.field_alert_text
- field.field.node.marketing_alert.field_noalert_paths
- node.type.marketing_alert
module:
- link
- text
- user
_core:
default_config_hash: jYyH2XXmgOpgIKWfHlNumUpLdYGuVB0TjXrsQCCMCLE
id: node.marketing_alert.default
targetEntityType: node
bundle: marketing_alert
mode: default
content:
field_alert_cta:
weight: 1
label: hidden
settings:
trim_length: null
url_only: false
url_plain: false
rel: '0'
target: '0'
third_party_settings: { }
type: link
region: content
field_alert_text:
weight: 0
label: hidden
settings: { }
third_party_settings: { }
type: text_default
region: content
hidden:
field_alert_background_color: true
field_alert_paths: true
field_noalert_paths: true
links: true
search_api_excerpt: true
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.marketing_alert.field_alert_background_color
- field.field.node.marketing_alert.field_alert_cta
- field.field.node.marketing_alert.field_alert_paths
- field.field.node.marketing_alert.field_alert_text
- field.field.node.marketing_alert.field_noalert_paths
- node.type.marketing_alert
module:
- user
_core:
default_config_hash: emWCvhM2obmdbbu3gk6aC93Lb2wEmkM-sMxIKYuskc8
id: node.marketing_alert.teaser
targetEntityType: node
bundle: marketing_alert
mode: teaser
content:
links:
weight: 100
settings: { }
third_party_settings: { }
region: content
hidden:
field_alert_background_color: true
field_alert_cta: true
field_alert_paths: true
field_alert_text: true
field_noalert_paths: true
search_api_excerpt: true
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_alert_level
- node.type.emergency_alert
module:
- options
id: node.emergency_alert.field_alert_level
field_name: field_alert_level
entity_type: node
bundle: emergency_alert
label: 'Alert Level'
description: 'Select an alert level form red (highest) to gray (lowest).'
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_alert_paths
- node.type.emergency_alert
id: node.emergency_alert.field_alert_paths
field_name: field_alert_paths
entity_type: node
bundle: emergency_alert
label: Pages