sample files from a smithsonian project

This commit is contained in:
2024-05-22 00:26:01 -04:00
commit 265541edc3
76 changed files with 2140 additions and 0 deletions
@@ -0,0 +1,6 @@
{% if content.0['#items'] is not null %}
{% include "@components/facets/facet-group.twig" with {
facet_group_title: label,
facet_group_items: content
}%}
{% endif %}
@@ -0,0 +1,3 @@
{% include '@components/horizontal-facets/horizontal-facets.twig' with {
facets: content.0['#items']
}%}
@@ -0,0 +1,49 @@
{#
/**
* @file
* Theme override for a menu block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: HTML attributes for the containing element.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: HTML attributes for the title element.
* - content_attributes: HTML attributes for the content element.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* Headings should be used on navigation menus that consistently appear on
* multiple pages. When this menu block's label is configured to not be
* displayed, it is automatically made invisible using the 'visually-hidden' CSS
* class, which still keeps it visible for screen-readers and assistive
* technology. Headings allow screen-reader and keyboard only users to navigate
* to or skip the links.
* See http://juicystudio.com/article/screen-readers-display-none.php and
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*/
#}
{# Label. If not displayed, we still provide it for screen readers. #}
{% if not configuration.label_display %}
{% set title_attributes = title_attributes.addClass('visually-hidden') %}
{% endif %}
{{ title_prefix }}
{% include "@elements/text/headings/_heading.twig" with {
"heading_level": 2,
"heading": label,
} %}
{{ title_suffix }}
{# Menu. #}
{% block content %}
{{ content }}
{% endblock %}
+5
View File
@@ -0,0 +1,5 @@
{% include "@components/subnav/subnav.twig" with {
subnav_title: label,
subnav_menu: content,
header_id: 'subnav-header-' ~ attributes.id,
}%}
@@ -0,0 +1,2 @@
{{ content }}
+37
View File
@@ -0,0 +1,37 @@
{#
/**
* @file
* Theme override to display a block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*/
#}
<div {{ bem('block') }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes.addClass('h2') }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>
@@ -0,0 +1,23 @@
{% set image %}
{% if content.field_header.0['#paragraph'].field_image is not empty %}
{% set url = file_url(content.field_header.0['#paragraph'].field_image.entity.field_media_image.entity.uri.value) %}
{% set alt = content.field_header.0['#paragraph'].field_image.entity.field_media_image.alt %}
<img src="{{ url }}" alt="{{ alt }}"/>
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="sample placeholder image" />
{% endif %}
{% endset %}
{% include '@templates/publication.twig' with {
publication_header: content.field_header|field_value,
publication_media: image,
publication_purchase_url: content.field_url.0['#url'],
publication_author: content.field_authors|field_value,
publication_editor: content.field_editors|field_value,
publication_publisher: content.field_publisher|field_value,
publication_year: content.field_year|field_value,
publication_series: content.field_series|field_value,
publication_type: content.field_publication_type|field_value,
publication_body: content.body,
publication_related_content: false
}%}
@@ -0,0 +1,26 @@
{# Set image from page header if it exists #}
{% if content.field_header.0['#paragraph'].field_image is not empty %}
{% set src = file_url(content.field_header.0['#paragraph'].field_image.entity.field_media_image.entity.uri.value|image_style('medium_4x3')) %}
{% set alt = content.field_header.0['#paragraph'].field_image.entity.field_media_image.alt %}
{% set image %}
<img src="{{ src }}" alt="{{ alt ? alt : '' }}" />
{% endset %}
{% endif %}
{# Trim summary #}
{% if content.field_summary.0['#context'].value|length > 250 %}
{% set summary %}
{{ content.field_summary.0['#context'].value|slice(0, 250) }}...
{% endset %}
{% else %}
{% set summary = content.field_summary|field_value %}
{% endif %}
{% include "@components/search-listing/search-listing.twig" with {
listing_eyebrow: 'Publication'|t,
listing_title: label,
listing_meta: false,
listing_summary: summary,
listing_media: image ? image : false,
listing_url: url,
}%}
@@ -0,0 +1,28 @@
{% set image %}
{% if content.field_header|render|striptags('<img>')|trim %}
{{ content.field_header }}
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="" aria-hidden="true" />
{% endif %}
{% endset %}
{% embed "@components/teaser/teaser--listing/teaser--listing.twig" with {
teaser_media: image,
teaser_url: url,
teaser_link_text: 'View publication details'|t,
teaser_link_title: label,
modifier_classes: attributes.class|join(' ')|trim,
drupal_attributes: attributes|without('class'),
} %}
{% block content %}
{{ title_suffix.contextual_links }}
{{ content.field_year }}
{% include '@components/teaser/_teaser-title.twig' with {
title_tag: 'h4',
teaser_title: label,
modifier_classes: false,
drupal_attributes: false,
} %}
{{ content|without('field_header', 'field_year') }}
{% endblock %}
{% endembed %}
@@ -0,0 +1,21 @@
{% set image %}
{% if content.field_header.0['#paragraph'].field_image is not empty %}
{% set src = file_url(content.field_header.0['#paragraph'].field_image.entity.field_media_image.entity.uri.value|image_style('medium_4x3')) %}
{% set alt = content.field_header.0['#paragraph'].field_image.entity.field_media_image.alt %}
<img src="{{ src }}" alt="{{ alt ? alt : '' }}"/>
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="sample placeholder image" />
{% endif %}
{% endset %}
{% include "@components/teaser/teaser.twig" with {
modifier_classes: attributes.class|join(' ')|trim,
drupal_attributes: attributes|without('class'),
teaser_image: image,
teaser_eyebrow: content.field_year|field_value,
teaser_title: label|field_value,
teaser_body: content.field_summary|field_value,
teaser_link_class: 'arrow-link',
teaser_link_url: url,
teaser_link_text: 'Read More'
}%}
@@ -0,0 +1,7 @@
{% include "@templates/story.twig" with {
story_has_footer: tags is not empty ? true : false,
story_header: content.field_header|field_value,
story_content: content.field_content|field_value,
story_tags: content.field_keywords|field_value,
story_related_stories: drupal_view('story_related_card')
}%}
@@ -0,0 +1,15 @@
{% set image %}
{% if content.field_header|render|striptags('<img>')|trim is not empty %}
{{ content.field_header }}
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="" aria-hidden="true" />
{% endif %}
{% endset %}
{% include "@components/related-content/_related-content-item.twig" with {
title: label,
url: url,
date: content|without('field_header'),
media: image,
header_id: 'related-card-' ~ node.id(),
}%}
@@ -0,0 +1,26 @@
{# Set image from page header if it exists #}
{% if content.field_header.0['#paragraph'].field_image is not empty %}
{% set src = file_url(content.field_header.0['#paragraph'].field_image.entity.field_media_image.entity.uri.value|image_style('medium_4x3')) %}
{% set alt = content.field_header.0['#paragraph'].field_image.entity.field_media_image.alt %}
{% set image %}
<img src="{{ src }}" alt="{{ alt ? alt : '' }}" />
{% endset %}
{% endif %}
{# Trim summary #}
{% if content.field_summary.0['#context'].value|length > 250 %}
{% set summary %}
{{ content.field_summary.0['#context'].value|slice(0, 250) }}...
{% endset %}
{% else %}
{% set summary = content.field_summary|field_value %}
{% endif %}
{% include "@components/search-listing/search-listing.twig" with {
listing_eyebrow: 'Story'|t,
listing_title: label,
listing_meta: false,
listing_summary: summary,
listing_media: image ? image : false,
listing_url: url,
}%}
@@ -0,0 +1,26 @@
{% set image %}
{% if content.field_header|render|striptags('<img>')|trim %}
{{ content.field_header }}
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="" aria-hidden="true" />
{% endif %}
{% endset %}
{% embed "@components/teaser/teaser--listing/teaser--listing.twig" with {
teaser_media: image,
teaser_url: url,
teaser_link_text: 'Read story'|t,
teaser_link_title: label,
modifier_classes: attributes.class|join(' ')|trim,
drupal_attributes: attributes|without('class'),
} %}
{% block content %}
{{ title_suffix.contextual_links }}
{{ content.field_series }}
{% include '@components/teaser/_teaser-title.twig' with {
title_tag: 'h4',
teaser_title: label,
} %}
{{ content|without('field_header', 'field_series') }}
{% endblock %}
{% endembed %}
@@ -0,0 +1,19 @@
{% set image %}
{% if content.field_header.0['#paragraph'].field_image is not empty %}
{% set src = file_url(content.field_header.0['#paragraph'].field_image.entity.field_media_image.entity.uri.value|image_style('medium_4x3')) %}
{% set alt = content.field_header.0['#paragraph'].field_image.entity.field_media_image.alt %}
<img src="{{ src }}" alt="{{ alt ? alt : '' }}"/>
{% else %}
<img src="/themes/custom/cdesai_emulsify/images/default.jpg" alt="sample placeholder image" />
{% endif %}
{% endset %}
{% include "@components/teaser/teaser.twig" with {
teaser_image: image,
teaser_eyebrow: content.field_series|field_value,
teaser_title: label|field_value,
teaser_body: content.field_summary|field_value,
teaser_link_class: 'arrow-link',
teaser_link_url: url,
teaser_link_text: 'Read More'
}%}
+95
View File
@@ -0,0 +1,95 @@
{#
/**
* @file
* Theme override to display a node.
*
* Available variables:
* - node: The node entity with limited access to object properties and methods.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - node.getCreatedTime() will return the node creation timestamp.
* - node.hasField('field_example') returns TRUE if the node bundle includes
* field_example. (This does not indicate the presence of a value in this
* field.)
* - node.isPublished() will return whether the node is published or not.
* Calling other methods, such as node.delete(), will result in an exception.
* See \Drupal\node\Entity\Node for a full list of public properties and
* methods for the node object.
* - label: The title of the node.
* - content: All node items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - author_picture: The node author user entity, rendered using the "compact"
* view mode.
* - metadata: Metadata for this node.
* - date: Themed creation date field.
* - author_name: Themed author name field.
* - url: Direct URL of the current node.
* - display_submitted: Whether submission information should be displayed.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - node: The current template type (also known as a "theming hook").
* - node--type-[type]: The current node type. For example, if the node is an
* "Article" it would result in "node--type-article". Note that the machine
* name will often be in a short form of the human readable label.
* - node--view-mode-[view_mode]: The View Mode of the node; for example, a
* teaser would result in: "node--view-mode-teaser", and
* full: "node--view-mode-full".
* The following are controlled through the node publishing options.
* - node--promoted: Appears on nodes promoted to the front page.
* - node--sticky: Appears on nodes ordered above other non-sticky nodes in
* teaser listings.
* - node--unpublished: Appears on unpublished nodes visible only to site
* admins.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - content_attributes: Same as attributes, except applied to the main
* content tag that appears in the template.
* - author_attributes: Same as attributes, except applied to the author of
* the node tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* - view_mode: View mode; for example, "teaser" or "full".
* - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
* - page: Flag for the full page state. Will be true if view_mode is 'full'.
* - readmore: Flag for more state. Will be true if the teaser content of the
* node cannot hold the main body content.
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_node()
*
* @todo Remove the id attribute (or make it a class), because if that gets
* rendered twice on a page this is invalid CSS for example: two lists
* in different view modes.
*/
#}
<article {{ bem("node") }}>
{{ title_prefix }}
<h2>{{ label }}</h2>
{{ title_suffix }}
{% if display_submitted %}
<footer>
{{ author_picture }}
<div{{ author_attributes }}>
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}
<div{{ content_attributes }}>
{{ content }}
</div>
</article>
+20
View File
@@ -0,0 +1,20 @@
{#
/**
* @file
* Theme override for page titles.
*
* Available variables:
* - title_attributes: HTML attributes for the page title element.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title: The page title, for use in the actual content.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*/
#}
{{ title_prefix }}
{% if title %}
<h1>{{ title }}</h1>
{% endif %}
{{ title_suffix }}
+109
View File
@@ -0,0 +1,109 @@
{#
/**
* @file
* Theme override to display a table.
*
* Available variables:
* - attributes: HTML attributes to apply to the <table> tag.
* - caption: A localized string for the <caption> tag.
* - colgroups: Column groups. Each group contains the following properties:
* - attributes: HTML attributes to apply to the <col> tag.
* Note: Drupal currently supports only one table header row, see
* https://www.drupal.org/node/893530 and
* http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109.
* - header: Table header cells. Each cell contains the following properties:
* - tag: The HTML tag name to use; either 'th' or 'td'.
* - attributes: HTML attributes to apply to the tag.
* - content: A localized string for the title of the column.
* - field: Field name (required for column sorting).
* - sort: Default sort order for this column ("asc" or "desc").
* - sticky: A flag indicating whether to use a "sticky" table header.
* - rows: Table rows. Each row contains the following properties:
* - attributes: HTML attributes to apply to the <tr> tag.
* - data: Table cells.
* - no_striping: A flag indicating that the row should receive no
* 'even / odd' styling. Defaults to FALSE.
* - cells: Table cells of the row. Each cell contains the following keys:
* - tag: The HTML tag name to use; either 'th' or 'td'.
* - attributes: Any HTML attributes, such as "colspan", to apply to the
* table cell.
* - content: The string to display in the table cell.
* - active_table_sort: A boolean indicating whether the cell is the active
table sort.
* - footer: Table footer rows, in the same format as the rows variable.
* - empty: The message to display in an extra row if table does not have
* any rows.
* - no_striping: A boolean indicating that the row should receive no striping.
* - header_columns: The number of columns in the header.
*
* @see template_preprocess_table()
*/
#}
<table{{ attributes.addClass('table') }}>
{% if caption %}
<caption>{{ caption }}</caption>
{% endif %}
{% for colgroup in colgroups %}
{% if colgroup.cols %}
<colgroup{{ colgroup.attributes }}>
{% for col in colgroup.cols %}
<col{{ col.attributes }} />
{% endfor %}
</colgroup>
{% else %}
<colgroup{{ colgroup.attributes }} />
{% endif %}
{% endfor %}
{% if header %}
<thead>
<tr>
{% for cell in header %}
<{{ cell.tag }}{{ cell.attributes.addClass('table__heading-cell') }}>
{{- cell.content -}}
</{{ cell.tag }}>
{% endfor %}
</tr>
</thead>
{% endif %}
{% if rows %}
<tbody>
{% for row in rows %}
<tr{{ row.attributes.addClass('table__row') }}>
{% for cell in row.cells %}
<{{ cell.tag }}{{ cell.attributes.addClass('table__cell') }}>
{{- cell.content -}}
</{{ cell.tag }}>
{% endfor %}
</tr>
{% endfor %}
</tbody>
{% elseif empty %}
<tbody>
<tr class="table__row">
<td colspan="{{ header_columns }}" class="table__cell">{{ empty }}</td>
</tr>
</tbody>
{% endif %}
{% if footer %}
<tfoot>
{% for row in footer %}
<tr{{ row.attributes }}>
{%
set footer_cell_classes = [
'table__heading-cell',
'table__footer-cell',
]
%}
{% for cell in row.cells %}
<{{ cell.tag }}{{ cell.attributes.addClass(footer_cell_classes) }}>
{{- cell.content -}}
</{{ cell.tag }}>
{% endfor %}
</tr>
{% endfor %}
</tfoot>
{% endif %}
</table>
@@ -0,0 +1,20 @@
{% if label_display == 'visually_hidden' %}
<div{{ title_attributes.addClass('visually-hidden') }}>{{ label }}</div>
{% endif %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
{% include '@components/teaser/teaser--small/_teaser-eyebrow.twig' with {
drupal_attributes: item.attributes|without('class'),
teaser_eyebrow: item.content,
} %}
{% endfor %}
</div>
{% else %}
{% for item in items %}
{% include '@components/teaser/teaser--small/_teaser-eyebrow.twig' with {
drupal_attributes: attributes|without('class'),
teaser_eyebrow: item.content,
} %}
{% endfor %}
{% endif %}
@@ -0,0 +1,26 @@
{% macro display_date(date_content, attributes) %}
{% set rendered = date_content|render|striptags|trim %}
{% set dates = rendered|split(',') %}
{% include '@components/teaser/teaser--event/_teaser-date.twig' with {
teaser_start: dates.0|trim,
teaser_end: dates|length > 1 ? dates.1|trim : false,
drupal_attributes: attributes|without('class'),
modifier_classes: attributes.class|join(' ')|trim
} %}
{% endmacro %}
{% if label_display == 'visually_hidden' %}
<div{{ title_attributes.addClass('visually-hidden') }}>{{ label }}</div>
{% endif %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
{{ _self.display_date(item.content, item.attributes) }}
{% endfor %}
</div>
{% else %}
{% for item in items %}
{{ _self.display_date(item.content, attributes) }}
{% endfor %}
{% endif %}
@@ -0,0 +1,22 @@
{% if label_display == 'visually_hidden' %}
<div{{ title_attributes.addClass('visually-hidden') }}>{{ label }}</div>
{% endif %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
{% include '@components/teaser/teaser--event/_teaser-location.twig' with {
drupal_attributes: item.attributes|without('class'),
teaser_location: item.content,
teaser_location_label: not label_hidden ? label : false,
} %}
{% endfor %}
</div>
{% else %}
{% for item in items %}
{% include '@components/teaser/teaser--event/_teaser-location.twig' with {
drupal_attributes: attributes|without('class'),
teaser_location: item.content,
teaser_location_label: not label_hidden ? label : false,
} %}
{% endfor %}
{% endif %}
@@ -0,0 +1,20 @@
{% if label_display == 'visually_hidden' %}
<div{{ title_attributes.addClass('visually-hidden') }}>{{ label }}</div>
{% endif %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
{% include '@components/teaser/_teaser-body.twig' with {
drupal_attributes: item.attributes|without('class'),
teaser_body: item.content,
} %}
{% endfor %}
</div>
{% else %}
{% for item in items %}
{% include '@components/teaser/_teaser-body.twig' with {
drupal_attributes: attributes|without('class'),
teaser_body: item.content,
} %}
{% endfor %}
{% endif %}
@@ -0,0 +1,32 @@
{%
set title_classes = [
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
<p{{ item.attributes }}>{{ item.content }}</p>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<p{{ attributes }}>{{ item.content }}</p>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes }}>
<h3{{ title_attributes.addClass(title_classes) }}>{{ label }}</h3>
{% if multiple %}
<div>
{% endif %}
{% for item in items %}
<p{{ item.attributes }}>{{ item.content }}</p>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
{% endif %}
@@ -0,0 +1,42 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*/
@TODO: THIS CAN BE REMOVED IF BEM CLASSES CAN BE APPLIED IN WYSIWYG
#}
{% include directory ~ "/templates/fields/_field-wysiwyg.twig" %}
@@ -0,0 +1,42 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*/
@TODO: THIS CAN BE REMOVED IF WYWSIWYG BEM CLASSES CAN BE APPLIED
#}
{% include directory ~ "/templates/fields/_field-wysiwyg.twig" %}
+70
View File
@@ -0,0 +1,70 @@
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
*
* @see template_preprocess_field()
*/
#}
{%
set title_classes = [
label_display == 'visually_hidden' ? 'visually-hidden',
]
%}
{% if label_hidden %}
{% if multiple %}
<div{{ attributes }}>
{% for item in items %}
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
</div>
{% else %}
{% for item in items %}
<div{{ attributes }}>{{ item.content }}</div>
{% endfor %}
{% endif %}
{% else %}
<div{{ attributes }}>
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% if multiple %}
<div>
{% endif %}
{% for item in items %}
<div{{ item.attributes }}>{{ item.content }}</div>
{% endfor %}
{% if multiple %}
</div>
{% endif %}
</div>
{% endif %}
+15
View File
@@ -0,0 +1,15 @@
{#
/**
* @file
* Theme override for a 'checkboxes' #type form element.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered checkboxes.
*
* @see template_preprocess_checkboxes()
*/
@todo: remove this file once https://www.drupal.org/node/1819284 is resolved.
This is identical to core/modules/system/templates/container.html.twig
#}
{% include "@elements/forms/_checkboxes.twig" %}
@@ -0,0 +1,22 @@
{#
/**
* @file
* Theme override for an individual form element.
*
* Available variables for all fields:
* - multiple: Whether there are multiple instances of the field.
*
* Available variables for single cardinality fields:
* - elements: Form elements to be rendered.
*
* Available variables when there are multiple fields.
* - table: Table of field items.
* - description: The description element containing the following properties:
* - content: The description content of the form element.
* - attributes: HTML attributes to apply to the description container.
* - button: "Add another item" button.
*
* @see template_preprocess_field_multiple_value_form()
*/
#}
{% include "@elements/forms/_multi-value.twig" %}
+23
View File
@@ -0,0 +1,23 @@
{#
/**
* @file
* Theme override for a fieldset element and its children.
*
* Available variables:
* - attributes: HTML attributes for the fieldset element.
* - errors: (optional) Any errors for this fieldset element, may not be set.
* - required: Boolean indicating whether the fieldeset element is required.
* - legend: The legend element containing the following properties:
* - title: Title of the fieldset, intended for use as the text of the legend.
* - attributes: HTML attributes to apply to the legend.
* - description: The description element containing the following properties:
* - content: The description content of the fieldset.
* - attributes: HTML attributes to apply to the description container.
* - children: The rendered child elements of the fieldset.
* - prefix: The content to add before the fieldset children.
* - suffix: The content to add after the fieldset children.
*
* @see template_preprocess_fieldset()
*/
#}
{% include "@elements/forms/_fieldset.twig" %}
@@ -0,0 +1,15 @@
{#
/**
* @file
* Theme override for a form element label.
*
* Available variables:
* - title: The label's text.
* - title_display: Elements title_display setting.
* - required: An indicator for whether the associated form element is required.
* - attributes: A list of HTML attributes for the label.
*
* @see template_preprocess_form_element_label()
*/
#}
{% include "@elements/forms/_form-label.twig" %}
+59
View File
@@ -0,0 +1,59 @@
{#
/**
* @file
* Theme override for a form element.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - errors: (optional) Any errors for this form element, may not be set.
* - prefix: (optional) The form element prefix, may not be set.
* - suffix: (optional) The form element suffix, may not be set.
* - required: The required marker, or empty if the associated form element is
* not required.
* - type: The type of the element.
* - name: The name of the element.
* - label: A rendered label element.
* - label_display: Label display setting. It can have these values:
* - before: The label is output before the element. This is the default.
* The label includes the #title and the required marker, if #required.
* - after: The label is output after the element. For example, this is used
* for radio and checkbox #type elements. If the #title is empty but the
* field is #required, the label will contain only the required marker.
* - invisible: Labels are critical for screen readers to enable them to
* properly navigate through forms but can be visually distracting. This
* property hides the label for everyone except screen readers.
* - attribute: Set the title attribute on the element to create a tooltip but
* output no label element. This is supported only for checkboxes and radios
* in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement().
* It is used where a visual label is not needed, such as a table of
* checkboxes where the row and column provide the context. The tooltip will
* include the title and required marker.
* - description: (optional) A list of description properties containing:
* - content: A description of the form element, may not be set.
* - attributes: (optional) A list of HTML attributes to apply to the
* description content wrapper. Will only be set when description is set.
* - description_display: Description display setting. It can have these values:
* - before: The description is output before the element.
* - after: The description is output after the element. This is the default
* value.
* - invisible: The description is output after the element, hidden visually
* but available to screen readers.
* - disabled: True if the element is disabled.
* - title_display: Title display setting.
*
* @see template_preprocess_form_element()
*/
#}
{%
set classes = [
'js-form-item',
'form-item',
'js-form-type-' ~ type|clean_class,
'form-item-' ~ name|clean_class,
'js-form-item-' ~ name|clean_class,
title_display not in ['after', 'before'] ? 'form-no-label',
disabled == 'disabled' ? 'form-disabled',
errors ? 'form-item--error',
]
%}
{% include "@elements/forms/_form-element.twig" %}
+13
View File
@@ -0,0 +1,13 @@
{#
/**
* @file
* Theme override for an 'input' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
*
* @see template_preprocess_input()
*/
#}
{% include "@elements/forms/_input.twig" %}
+13
View File
@@ -0,0 +1,13 @@
{#
/**
* @file
* Theme override for a 'radios' #type form element.
*
* Available variables
* - attributes: A list of HTML attributes for the wrapper element.
* - children: The rendered radios.
*
* @see template_preprocess_radios()
*/
#}
{% include "@elements/forms/_radios.twig" %}
+13
View File
@@ -0,0 +1,13 @@
{#
/**
* @file
* Theme override for a select element.
*
* Available variables:
* - attributes: HTML attributes for the select tag.
* - options: The option element children.
*
* @see template_preprocess_select()
*/
#}
{% include "@elements/forms/_select-element.twig" %}
+16
View File
@@ -0,0 +1,16 @@
{#
/**
* @file
* Theme override for a 'textarea' #type form element.
*
* Available variables
* - wrapper_attributes: A list of HTML attributes for the wrapper element.
* - attributes: A list of HTML attributes for the textarea element.
* - resizable: An indicator for whether the textarea is resizable.
* - required: An indicator for whether the textarea is required.
* - value: The textarea content.
*
* @see template_preprocess_textarea()
*/
#}
{% include "@elements/forms/_textarea.twig" %}
+28
View File
@@ -0,0 +1,28 @@
{% extends '@layouts/site-container/site-container.twig' %}
{% block site_content %}
{{ page.header }}
{{ drupal_entity('block', 'submenu') }}
{{ page.navigation }}
{{ page.breadcrumb }}
{{ page.highlighted }}
{{ page.help }}
<main id="main" class="main" role="main" tabindex="-1">
<div class="l-constrain mt-xl mb-3xl">
{{ page.content }}
</div>
</main>
{{ page.footer }}
{% endblock %}
{% block additional_content %}
{% if not is_front %}
{% include '@components/social-sharing/social-sharing.twig' with {
share_url: url('<current>'),
share_title: share_title,
share_id: 'social-sharing',
} %}
{% endif %}
{% endblock %}
+33
View File
@@ -0,0 +1,33 @@
{% extends '@layouts/site-container/site-container.twig' %}
{% block site_content %}
{{ page.header }}
{{ drupal_entity('block', 'submenu') }}
{{ page.navigation }}
{{ page.breadcrumb }}
{{ page.highlighted }}
{{ page.help }}
<main id="main" class="main" role="main" tabindex="-1">
{{ page.preface }}
{{ page.content }}
{% if not is_front %}
<a href="#social-sharing" class="visually-hidden focusable">
{{ 'Share this page'|t }}
</a>
{% endif %}
{{ page.postscript }}
</main>
{{ page.footer }}
{% endblock %}
{% block additional_content %}
{% if not is_front %}
{% include '@components/social-sharing/social-sharing.twig' with {
share_url: url('<current>'),
share_title: share_title,
share_id: 'social-sharing',
} %}
{% endif %}
{% endblock %}
+18
View File
@@ -0,0 +1,18 @@
{#
/**
* @file
* Theme override to display a region.
*
* Available variables:
* - content: The content for this region, typically blocks.
* - attributes: HTML attributes for the region div.
* - region: The name of the region variable as defined in the theme's
* .info.yml file.
*
* @see template_preprocess_region()
*/
#}
{% include "@layouts/footer/footer.twig" with {
footer_social_menu: drupal_menu('social-media'),
footer_legal_menu: drupal_menu('footer')
}%}
+18
View File
@@ -0,0 +1,18 @@
{#
/**
* @file
* Theme override to display a region.
*
* Available variables:
* - content: The content for this region, typically blocks.
* - attributes: HTML attributes for the region div.
* - region: The name of the region variable as defined in the theme's
* .info.yml file.
*
* @see template_preprocess_region()
*/
#}
{% include "@layouts/header/header.twig" with {
header_menu: drupal_menu('main'),
header_search: false
}%}
+8
View File
@@ -0,0 +1,8 @@
{% set attributes = attributes.setAttribute('aria-label', name) %}
{% include "@components/media/media--audio.twig" with {
audio: content.field_media_audio_file|field_value,
thumbnail: content.field_media_image|field_value,
modifier_classes: attributes.class|join(' ')|trim,
drupal_attributes: attributes|without('class'),
}%}
@@ -0,0 +1 @@
{{ content.field_media_image|field_value }}
+7
View File
@@ -0,0 +1,7 @@
{% set attributes = attributes.setAttribute('aria-label', name) %}
{% include "@components/media/media--image.twig" with {
image: content.field_media_image|field_value,
modifier_classes: attributes.class|join(' ')|trim,
drupal_attributes: attributes|without('class'),
}%}
@@ -0,0 +1,18 @@
{#
/**
* @file
* Default theme implementation of a responsive image.
*
* Available variables:
* - sources: The attributes of the <source> tags for this <picture> tag.
* - img_element: The controlling image, with the fallback image in srcset.
* - output_image_tag: Whether or not to output an <img> tag instead of a
* <picture> tag.
*
* @see template_preprocess()
* @see template_preprocess_responsive_image()
*
* @ingroup themeable
*/
#}
{% include "@elements/images/image/responsive-image.twig" %}
+11
View File
@@ -0,0 +1,11 @@
{#
/**
* @file
* Theme override for a breadcrumb trail.
*
* Available variables:
* - breadcrumb: Breadcrumb trail items.
*/
#}
{% include "@components/breadcrumbs/breadcrumbs.twig" %}
@@ -0,0 +1,4 @@
{% include "@components/menus/menu.twig" with {
menu_name: 'legal',
items: items,
}%}
+26
View File
@@ -0,0 +1,26 @@
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link url, instance of \Drupal\Core\Url
* - localized_options: Menu link localized options.
* - is_expanded: TRUE if the link has visible children within the current
* menu tree.
* - is_collapsed: TRUE if the link has children within the current menu tree
* that are not currently visible.
* - in_active_trail: TRUE if the link is in the active trail.
*/
#}
{{ attach_library('cdesai_emulsify/main_menu') }}
{% include "@components/menus/main-menu/main-menu.twig" with {
menu_items: items,
}%}
@@ -0,0 +1,15 @@
{#
/**
* @file
* Theme override for a single local action link.
*
* Available variables:
* - attributes: HTML attributes for the wrapper element.
* - link: A rendered link element.
*
* @see template_preprocess_menu_local_action()
*/
#}
{% include "@elements/lists/_list-item.twig" with {
list_item_content: link
} %}
+21
View File
@@ -0,0 +1,21 @@
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
* - title: The menu link title.
* - url: The menu link url, instance of \Drupal\Core\Url
* - localized_options: Menu link localized options.
* - is_expanded: TRUE if the link has visible children within the current
* menu tree.
* - is_collapsed: TRUE if the link has children within the current menu tree
* that are not currently visible.
* - in_active_trail: TRUE if the link is in the active trail.
*/
#}
{% include "@components/menus/menu.twig" %}
+32
View File
@@ -0,0 +1,32 @@
{#
/**
* @file
* Theme override to display a pager.
*
* Available variables:
* - items: List of pager items.
* The list is keyed by the following elements:
* - first: Item for the first page; not present on the first page of results.
* - previous: Item for the previous page; not present on the first page
* of results.
* - next: Item for the next page; not present on the last page of results.
* - last: Item for the last page; not present on the last page of results.
* - pages: List of pages, keyed by page number.
* Sub-sub elements:
* items.first, items.previous, items.next, items.last, and each item inside
* items.pages contain the following elements:
* - href: URL with appropriate query parameters for the item.
* - attributes: A keyed list of HTML attributes for the item.
* - text: The visible text used for the item link, such as "‹ Previous"
* or "Next ›".
* - current: The page number of the current page.
* - ellipses: If there are more pages than the quantity allows, then an
* ellipsis before or after the listed pages may be present.
* - previous: Present if the currently visible list of pages does not start
* at the first page.
* - next: Present if the visible list of pages ends before the last page.
*
* @see template_preprocess_pager()
*/
#}
{% include "@components/pager/pager.twig" %}
@@ -0,0 +1,12 @@
{{ attach_library('cdesai_emulsify/accordion') }}
{% set hidden = content.field_hide.0['#markup'] == 'Yes' ? true : false %}
{% if not hidden %}
{% include "@components/accordion/accordion-group.twig" with {
modifier_classes: content.field_tabs|field_value|length > 5 ? 'accordion-group--small' : false,
accordion_group_items: content.field_tabs|field_value,
accordion_group_title: content.field_title|field_value,
accordion_group_intro: content.field_description|field_value,
}%}
{% endif %}
@@ -0,0 +1,11 @@
{{ attach_library('cdesai_emulsify/aside') }}
{% set alignment_class %}
aside--{{ content.field_alignment.0['#markup']|lower }}
{% endset %}
{% include "@components/aside/aside.twig" with {
modifier_classes: alignment_class,
aside_title: content.field_title|field_value,
aside_content: content.field_body|field_value
}%}
@@ -0,0 +1,26 @@
{% set classes = [
'l-paragraph',
] %}
<div{{ attributes.addClass(classes) }}>
<div class="l-constrain">
{% embed '@components/horizontal-tabs/horizontal-tabs.twig' with {
modifier_classes: content.tab_titles|length <= 3 ? 'horizontal-tabs--large' : false,
alignment_class: content.tab_titles|length <= 2 ? 'justify-evenly' : false,
horizontal_tabs_label: content.field_label|field_value,
horizontal_tabs_title: content.field_title|field_value,
horizontal_tabs_subtitle: content.field_description|field_value
}%}
{% block tablist %}
{{ content.tab_titles }}
{% endblock %}
{% block tab_panels %}
{{ content.field_tabs|field_value }}
{% endblock %}
{% endembed %}
</div>
</div>
@@ -0,0 +1,7 @@
{{ attach_library('cdesai_emulsify/gallery') }}
{% include "@components/gallery/gallery.twig" with {
gallery_title: content.field_title|field_value,
gallery_subtitle: content.field_description|field_value,
gallery_items: content.field_slides|field_value
}%}
+48
View File
@@ -0,0 +1,48 @@
{#
/**
* @file
* Default theme implementation to display a paragraph.
*
* Available variables:
* - paragraph: Full paragraph entity.
* - id: The paragraph ID.
* - bundle: The type of the paragraph, for example, "image" or "text".
* - authorid: The user ID of the paragraph author.
* - createdtime: Formatted creation date. Preprocess functions can
* reformat it by calling format_date() with the desired parameters on
* $variables['paragraph']->getCreatedTime().
* - content: All paragraph items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - paragraphs: The current template type (also known as a "theming hook").
* - paragraphs--type-[type]: The current paragraphs type. For example, if the paragraph is an
* "Image" it would result in "paragraphs--type--image". Note that the machine
* name will often be in a short form of the human readable label.
* - paragraphs--view-mode--[view_mode]: The View Mode of the paragraph; for example, a
* preview would result in: "paragraphs--view-mode--preview", and
* default: "paragraphs--view-mode--default".
* - view_mode: View mode; for example, "preview" or "full".
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_paragraph()
*
* @ingroup themeable
*/
#}
{%
set classes = [
paragraph.bundle|clean_class
]
%}
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>