added contrib theme basic
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{% extends "block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for local actions (primary admin actions.)
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if content %}
|
||||
<nav class="action-links">{{ content }}</nav>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends "@block/block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for tabs.
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if content %}
|
||||
<nav class="tabs" role="navigation" aria-label="{{ 'Tabs'|t }}">
|
||||
{{ content }}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the search form 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, including:
|
||||
* - 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: A list HTML attributes populated by modules, intended to
|
||||
* be added to the main container tag of this template. Includes:
|
||||
* - 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()
|
||||
* @see search_preprocess_block()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'block',
|
||||
'block-search',
|
||||
'container-inline',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if label %}
|
||||
<h2{{ title_attributes }}>{{ label }}</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
{% extends "block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a branding block.
|
||||
*
|
||||
* Each branding element variable (logo, name, slogan) is only available if
|
||||
* enabled in the block configuration.
|
||||
*
|
||||
* Available variables:
|
||||
* - site_logo: Logo for site as defined in Appearance or theme settings.
|
||||
* - site_name: Name for site as defined in Site information settings.
|
||||
* - site_slogan: Slogan for site as defined in Site information settings.
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if site_logo %}
|
||||
<a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-logo">
|
||||
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if site_name %}
|
||||
<div class="site-name">
|
||||
<a href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if site_slogan %}
|
||||
<div class="site-slogan">{{ site_slogan }}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,56 @@
|
||||
{#
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'block',
|
||||
'block-menu',
|
||||
'navigation',
|
||||
'menu--' ~ derivative_plugin_id|clean_class,
|
||||
]
|
||||
%}
|
||||
{% set heading_id = attributes.id ~ '-menu'|clean_id %}
|
||||
<nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes.addClass(classes)|without('role', 'aria-labelledby') }}>
|
||||
{# 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 }}
|
||||
<h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
|
||||
{{ title_suffix }}
|
||||
|
||||
{# Menu. #}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</nav>
|
||||
@@ -0,0 +1,32 @@
|
||||
{% extends "@block/block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @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()
|
||||
*/
|
||||
#}
|
||||
{% set attributes = attributes.addClass([
|
||||
'block-' ~ configuration.provider|clean_class,
|
||||
attributes.id
|
||||
]) %}
|
||||
@@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a breadcrumb trail.
|
||||
*
|
||||
* Available variables:
|
||||
* - breadcrumb: Breadcrumb trail items.
|
||||
*/
|
||||
#}
|
||||
{% if breadcrumb %}
|
||||
<nav class="breadcrumb" role="navigation" aria-labelledby="system-breadcrumb">
|
||||
<h2 id="system-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
|
||||
<ol>
|
||||
{% for item in breadcrumb %}
|
||||
<li>
|
||||
{% if item.url %}
|
||||
<a href="{{ item.url }}">{{ item.text }}</a>
|
||||
{% else %}
|
||||
{{ item.text }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for comments.
|
||||
*
|
||||
* Available variables:
|
||||
* - author: Comment author. Can be a link or plain text.
|
||||
* - content: The content-related items for the comment display. Use
|
||||
* {{ content }} to print them all, or print a subset such as
|
||||
* {{ content.field_example }}. Use the following code to temporarily suppress
|
||||
* the printing of a given child element:
|
||||
* @code
|
||||
* {{ content|without('field_example') }}
|
||||
* @endcode
|
||||
* - created: Formatted date and time for when the comment was created.
|
||||
* Preprocess functions can reformat it by calling format_date() with the
|
||||
* desired parameters on the 'comment.created' variable.
|
||||
* - changed: Formatted date and time for when the comment was last changed.
|
||||
* Preprocess functions can reformat it by calling format_date() with the
|
||||
* desired parameters on the 'comment.changed' variable.
|
||||
* - permalink: Comment permalink.
|
||||
* - submitted: Submission information created from author and created
|
||||
* during template_preprocess_comment().
|
||||
* - user_picture: The comment author's profile picture.
|
||||
* - status: Comment status. Possible values are:
|
||||
* unpublished, published, or preview.
|
||||
* - title: Comment title, linked to the comment.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* The attributes.class may contain one or more of the following classes:
|
||||
* - comment: The current template type; e.g., 'theming hook'.
|
||||
* - by-anonymous: Comment by an unregistered user.
|
||||
* - by-{entity-type}-author: Comment by the author of the parent entity,
|
||||
* eg. by-node-author.
|
||||
* - preview: When previewing a new or edited comment.
|
||||
* The following applies only to viewers who are registered users:
|
||||
* - unpublished: An unpublished comment visible only to administrators.
|
||||
* - 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.
|
||||
* - content_attributes: List of classes for the styling of the comment content.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* tag that appears in the template.
|
||||
*
|
||||
* These variables are provided to give context about the parent comment (if
|
||||
* any):
|
||||
* - comment_parent: Full parent comment entity (if any).
|
||||
* - parent_author: Equivalent to author for the parent comment.
|
||||
* - parent_created: Equivalent to created for the parent comment.
|
||||
* - parent_changed: Equivalent to changed for the parent comment.
|
||||
* - parent_title: Equivalent to title for the parent comment.
|
||||
* - parent_permalink: Equivalent to permalink for the parent comment.
|
||||
* - parent: A text string of parent comment submission information created from
|
||||
* 'parent_author' and 'parent_created' during template_preprocess_comment().
|
||||
* This information is presented to help screen readers follow lengthy
|
||||
* discussion threads. You can hide this from sighted users using the class
|
||||
* visually-hidden.
|
||||
*
|
||||
* These two variables are provided for context:
|
||||
* - comment: Full comment object.
|
||||
* - entity: Entity the comments are attached to.
|
||||
*
|
||||
* @see template_preprocess_comment()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
|
||||
<article{{ attributes }}>
|
||||
{% if title %}
|
||||
{{ title_prefix }}
|
||||
{% endif %}
|
||||
|
||||
{#
|
||||
Hide the "new" indicator by default, let a piece of JavaScript ask
|
||||
the server which comments are new for the user. Rendering the final
|
||||
"new" indicator here would break the render cache.
|
||||
#}
|
||||
<mark class="hidden new" data-comment-timestamp="{{ new_indicator_timestamp }}"></mark>
|
||||
|
||||
{% if title %}
|
||||
<h3{{ title_attributes.addClass('title') }}>{{ title }}</h3>
|
||||
{{ title_suffix }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<footer>
|
||||
{{ user_picture }}
|
||||
<p class="submitted">{{ submitted }}</p>
|
||||
|
||||
{#
|
||||
Indicate the semantic relationship between parent and child comments
|
||||
for accessibility. The list is difficult to navigate in a screen
|
||||
reader without this information.
|
||||
#}
|
||||
{% if parent %}
|
||||
<p class="visually-hidden">{{ parent }}</p>
|
||||
{% endif %}
|
||||
|
||||
{{ permalink }}
|
||||
</footer>
|
||||
|
||||
<div{{ content_attributes.addClass('content') }}>
|
||||
{{ content|without('links') }}
|
||||
</div>
|
||||
{% if content.links %}
|
||||
{{ content.links }}
|
||||
{% endif %}
|
||||
</article>
|
||||
@@ -0,0 +1,42 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme override for comment fields.
|
||||
*
|
||||
* 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.
|
||||
* - 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 title output populated by modules, intended to
|
||||
* be displayed after the main title tag that appears in the template.
|
||||
* - comments: List of comments rendered through comment.html.twig.
|
||||
* - content_attributes: HTML attributes for the form title.
|
||||
* - comment_form: The 'Add new comment' form.
|
||||
* - comment_display_mode: Is the comments are threaded.
|
||||
* - comment_type: The comment type bundle ID for the comment field.
|
||||
* - 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()
|
||||
* @see comment_preprocess_field()
|
||||
*/
|
||||
#}
|
||||
<section{{ attributes.addClass('comments') }}>
|
||||
{% if comments and not label_hidden and (entity.entityType != 'node' or entity.bundle != 'forum') %}
|
||||
{{ title_prefix }}
|
||||
<h2{{ title_attributes }}>{{ label }}</h2>
|
||||
{{ title_suffix }}
|
||||
{% endif %}
|
||||
|
||||
{{ comments }}
|
||||
|
||||
{% if comment_form %}
|
||||
<h2{{ content_attributes.addClass('title') }}>{{ 'Add new comment'|t }}</h2>
|
||||
{{ comment_form }}
|
||||
{% endif %}
|
||||
</section>
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "@stable/field/field.html.twig" %}
|
||||
|
||||
{# Create classes array #}
|
||||
{% set classes = [] %}
|
||||
|
||||
{# BEM inspired class syntax: https://en.bem.info/
|
||||
Enable this code if you would like field classes like "article__tags", where article is the content type and field_tags is the field name.
|
||||
#}
|
||||
{% set classes = classes|merge([
|
||||
bundle ~ '__' ~ field_name|replace({'field_' : ''})|clean_class
|
||||
]) %}
|
||||
|
||||
|
||||
{% set attributes = attributes.addClass(classes) %}
|
||||
|
||||
{#
|
||||
Ensures that the visually hidden option for field labels works correctly.
|
||||
@todo: Remove when https://www.drupal.org/node/2779919 is resolved.
|
||||
#}
|
||||
{% set title_attributes = title_attributes.addClass(label_display == 'visually_hidden' ? 'visually-hidden') %}
|
||||
@@ -0,0 +1,81 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for the basic structure of a single Drupal page.
|
||||
*
|
||||
* Variables:
|
||||
* - logged_in: A flag indicating if user is logged in.
|
||||
* - root_path: The root path of the current page (e.g., node, admin, user).
|
||||
* - node_type: The content type for the current node, if the page is a node.
|
||||
* - css: A list of CSS files for the current page.
|
||||
* - head: Markup for the HEAD element (including meta tags, keyword tags, and
|
||||
* so on).
|
||||
* - head_title: A modified version of the page title, for use in the TITLE tag.
|
||||
* - head_title_array: List of text elements that make up the head_title
|
||||
* variable. May contain or more of the following:
|
||||
* - title: The title of the page.
|
||||
* - name: The name of the site.
|
||||
* - slogan: The slogan of the site.
|
||||
* - page_top: Initial rendered markup. This should be printed before 'page'.
|
||||
* - page: The rendered page markup.
|
||||
* - page_bottom: Closing rendered markup. This variable should be printed after
|
||||
* 'page'.
|
||||
* - styles: Style tags necessary to import all necessary CSS files in the head.
|
||||
* - scripts: Script tags necessary to load the JavaScript files and settings
|
||||
* in the head.
|
||||
* - db_offline: A flag indicating if the database is offline.
|
||||
*
|
||||
* @see template_preprocess_html()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<!DOCTYPE html>
|
||||
{% if ie_enabled_versions.ie8 %}
|
||||
{{- attach_library('basic/ie8') }}
|
||||
{% endif %}
|
||||
{% if ie_enabled_versions.ie9 or ie_enabled_versions.ie8 %}
|
||||
<!--[if lt IE 7]> <html{{ html_attributes.addClass('no-js', 'lt-ie9', 'lt-ie8', 'lt-ie7') }}><![endif]-->
|
||||
<!--[if IE 7]> <html{{ html_attributes.removeClass('lt-ie7') }}><![endif]-->
|
||||
<!--[if IE 8]> <html{{ html_attributes.removeClass('lt-ie8') }}><![endif]-->
|
||||
<!--[if gt IE 8]><!--><html{{ html_attributes.removeClass('lt-ie9') }}><!--<![endif]-->
|
||||
{% else -%}
|
||||
<html{{ html_attributes }}>
|
||||
{% endif %}
|
||||
<head>
|
||||
<head-placeholder token="{{ placeholder_token }}">
|
||||
<title>{{ head_title|safe_join(' | ') }}</title>
|
||||
<css-placeholder token="{{ placeholder_token }}">
|
||||
<js-placeholder token="{{ placeholder_token }}">
|
||||
</head>
|
||||
{% set classes = [] %}
|
||||
{% for role in user.roles %}
|
||||
{% set classes = classes|merge(['role--' ~ role|clean_class]) %}
|
||||
{% endfor %}
|
||||
|
||||
{% set sidebar_first = page.sidebar_first|render %}
|
||||
{% set sidebar_second = page.sidebar_second|render %}
|
||||
<body{{ attributes.addClass(classes,
|
||||
not is_front ? 'with-subnav',
|
||||
sidebar_first ? 'sidebar-first',
|
||||
sidebar_second ? 'sidebar-second',
|
||||
(sidebar_first and not sidebar_second) or (sidebar_second and not sidebar_first) ? 'one-sidebar',
|
||||
(sidebar_first and sidebar_second) ? 'two-sidebars',
|
||||
(not sidebar_first and not sidebar_second) ? 'no-sidebar'
|
||||
) }}>
|
||||
<div id="skip">
|
||||
<a href="#main-menu" class="visually-hidden focusable skip-link">
|
||||
{{ 'Skip to main navigation'|t }}
|
||||
</a>
|
||||
</div>
|
||||
{{ page_top }}
|
||||
{{ page }}
|
||||
{{ page_bottom }}
|
||||
<js-bottom-placeholder token="{{ placeholder_token }}">
|
||||
{% if browser_sync.enabled %}
|
||||
<script id="__bs_script__">
|
||||
document.write("<script async src='http://{{ browser_sync.host }}:{{ browser_sync.port }}/browser-sync/browser-sync-client.js'><\/script>".replace("HOST", location.hostname));
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for a local task link.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper element.
|
||||
* - is_active: Whether the task item is an active tab.
|
||||
* - link: A rendered link element.
|
||||
*
|
||||
* Note: This template renders the content for each task item in
|
||||
* menu-local-tasks.html.twig.
|
||||
*
|
||||
* @see template_preprocess_menu_local_task()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<li{{ attributes.addClass('tabs__tab').addClass(is_active ? 'tabs__tab--active') }}>{{ link }}</li>
|
||||
@@ -0,0 +1,29 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display primary and secondary local tasks.
|
||||
*
|
||||
* Available variables:
|
||||
* - primary: HTML list items representing primary tasks.
|
||||
* - secondary: HTML list items representing primary tasks.
|
||||
*
|
||||
* Each item in these variables (primary and secondary) can be individually
|
||||
* themed in menu-local-task.html.twig.
|
||||
*
|
||||
* @see template_preprocess_menu_local_tasks()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
|
||||
{{ attach_library('basic/tabs') }}
|
||||
|
||||
{% if primary %}
|
||||
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
|
||||
<ul class="tabs primary">{{ primary }}</ul>
|
||||
{% endif %}
|
||||
{% if secondary %}
|
||||
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
|
||||
<ul class="tabs secondary">{{ secondary }}</ul>
|
||||
{% endif %}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{#
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
#}
|
||||
{% import _self as menus %}
|
||||
|
||||
{#
|
||||
We call a macro which calls itself to render the full tree.
|
||||
@see http://twig.sensiolabs.org/doc/tags/macro.html
|
||||
#}
|
||||
{{ menus.menu_links(items, attributes, 0) }}
|
||||
|
||||
{% macro menu_links(items, attributes, menu_level) %}
|
||||
{% import _self as menus %}
|
||||
{% if items %}
|
||||
{% if menu_level == 0 %}
|
||||
<ul{{ attributes.addClass('menu') }}>
|
||||
{% else %}
|
||||
<ul class="menu">
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
{%
|
||||
set classes = [
|
||||
'menu-item',
|
||||
item.is_expanded ? 'menu-item--expanded',
|
||||
item.is_collapsed ? 'menu-item--collapsed',
|
||||
item.in_active_trail ? 'menu-item--active-trail',
|
||||
]
|
||||
%}
|
||||
<li{{ item.attributes.addClass(classes) }}>
|
||||
{{ link(item.title, item.url) }}
|
||||
{% if item.below %}
|
||||
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
{# Create classes array. The 'node' class is required for contextual edit links. #}
|
||||
{% set classes = [
|
||||
'node'
|
||||
] %}
|
||||
|
||||
{# BEM inspired class syntax: https://en.bem.info/
|
||||
Enable this code if you would like node classes like "article article--layout-teaser", where article is the content type and teaser is the view mode.
|
||||
{% set classes = classes|merge([
|
||||
node.bundle|clean_class,
|
||||
view_mode ? node.bundle|clean_class ~ '--layout-' ~ view_mode|clean_class
|
||||
]) %}
|
||||
{% set title_classes = [
|
||||
node.bundle|clean_class ~ '__title'
|
||||
] %}
|
||||
#}
|
||||
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
|
||||
{% if title_prefix or title_suffix or display_submitted or unpublished or page is empty and label %}
|
||||
<header>
|
||||
{{ title_prefix }}
|
||||
{% if not page and label %}
|
||||
<h2{{ title_attributes.addClass(title_classes) }}>
|
||||
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
|
||||
</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
|
||||
{% if display_submitted %}
|
||||
<div class="submitted">
|
||||
{{ author_picture }}
|
||||
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
|
||||
{{ metadata }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not node.published %}
|
||||
<p class="node--unpublished">{{ 'Unpublished'|t }}</p>
|
||||
{% endif %}
|
||||
</header>
|
||||
{% endif %}
|
||||
|
||||
<div{{ content_attributes.addClass('content') }}>
|
||||
{{ content|without('links') }}
|
||||
</div><!-- /.content -->
|
||||
|
||||
{% if content.links %}
|
||||
<div class="links">
|
||||
{{ content.links }}
|
||||
</div><!-- /.links -->
|
||||
{% endif %}
|
||||
|
||||
</article><!-- /.node -->
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
{% set main_menu = page.primary_menu|render %}
|
||||
{% set secondary_menu = page.secondary_menu|render %}
|
||||
<div{{ attributes.addClass(
|
||||
'layout-container',
|
||||
main_menu or secondary_menu ? 'with-navigation',
|
||||
secondary_menu ? 'with-subnav'
|
||||
) }}>
|
||||
|
||||
<!-- ______________________ HEADER _______________________ -->
|
||||
|
||||
<header id="header">
|
||||
<div class="container">
|
||||
{% if page.header %}
|
||||
<div id="header-region">
|
||||
{{ page.header }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header><!-- /#header -->
|
||||
|
||||
{% if main_menu or secondary_menu %}
|
||||
<nav id="navigation" class="menu{% if main_menu %} with-primary{% endif %}{% if secondary_menu %} with-secondary{% endif %}">
|
||||
<div class="container">
|
||||
{{ main_menu }}
|
||||
{{ secondary_menu }}
|
||||
</div>
|
||||
</nav><!-- /#navigation -->
|
||||
{% endif %}
|
||||
|
||||
<!-- ______________________ MAIN _______________________ -->
|
||||
|
||||
<div id="main">
|
||||
<div class="container">
|
||||
<section id="content">
|
||||
|
||||
<div id="content-header">
|
||||
|
||||
{{ page.breadcrumb }}
|
||||
|
||||
{% if page.highlighted|render %}
|
||||
<div id="highlighted">{{ page.highlighted }}</div>
|
||||
{% endif %}
|
||||
|
||||
{{ title_prefix }}
|
||||
|
||||
{% if title %}
|
||||
<h1 class="title">{{ title }}</h1>
|
||||
{% endif %}
|
||||
|
||||
{{ title_suffix }}
|
||||
{{ page.help }}
|
||||
|
||||
{% if tabs %}
|
||||
<div class="tabs">{{ tabs }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if action_links %}
|
||||
<ul class="action-links">{{ action_links }}</ul>
|
||||
{% endif %}
|
||||
|
||||
</div><!-- /#content-header -->
|
||||
|
||||
<div id="content-area">
|
||||
{{ page.content }}
|
||||
</div>
|
||||
|
||||
</section><!-- /#content -->
|
||||
|
||||
{% if page.sidebar_first|render %}
|
||||
<aside id="sidebar-first" class="column sidebar first">
|
||||
{{ page.sidebar_first }}
|
||||
</aside><!-- /#sidebar-first -->
|
||||
{% endif %}
|
||||
|
||||
{% if page.sidebar_second|render %}
|
||||
<aside id="sidebar-second" class="column sidebar second">
|
||||
{{ page.sidebar_second }}
|
||||
</aside><!-- /#sidebar-second -->
|
||||
{% endif %}
|
||||
</div><!-- /.container -->
|
||||
</div><!-- /#main -->
|
||||
|
||||
<!-- ______________________ FOOTER _______________________ -->
|
||||
|
||||
{% if page.footer|render %}
|
||||
<footer id="footer">
|
||||
<div class="container">
|
||||
{{ page.footer }}
|
||||
</div>
|
||||
</footer><!-- /#footer -->
|
||||
{% endif %}
|
||||
|
||||
</div><!-- /.layout-container -->
|
||||
@@ -0,0 +1,98 @@
|
||||
{#
|
||||
/**
|
||||
* @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()
|
||||
*/
|
||||
#}
|
||||
{% if items %}
|
||||
<nav class="pager" role="navigation" aria-labelledby="pagination-heading">
|
||||
<h4 id="pagination-heading" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
||||
<ul class="pager__items js-pager__items">
|
||||
{# Print first item if we are not on the first page. #}
|
||||
{% if items.first %}
|
||||
<li class="pager__item pager__item--first">
|
||||
<a href="{{ items.first.href }}" title="{{ 'Go to first page'|t }}"{{ items.first.attributes|without('href', 'title') }}>
|
||||
<span class="visually-hidden">{{ 'First page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.first.text|default('« First'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{# Print previous item if we are not on the first page. #}
|
||||
{% if items.previous %}
|
||||
<li class="pager__item pager__item--previous">
|
||||
<a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
|
||||
<span class="visually-hidden">{{ 'Previous page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.previous.text|default('‹ Previous'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{# Add an ellipsis if there are further previous pages. #}
|
||||
{% if ellipses.previous %}
|
||||
<li class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
||||
{% endif %}
|
||||
{# Now generate the actual pager piece. #}
|
||||
{% for key, item in items.pages %}
|
||||
<li class="pager__item{{ current == key ? ' pager__item--active' : '' }}">
|
||||
{% if current == key %}
|
||||
{% set title = 'Current page'|t %}
|
||||
{% else %}
|
||||
{% set title = 'Go to page @key'|t({'@key': key}) %}
|
||||
{% endif %}
|
||||
<a href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title') }}>
|
||||
<span class="visually-hidden">
|
||||
{{ current == key ? 'Current page'|t : 'Page'|t }}
|
||||
</span>
|
||||
{{- key -}}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{# Add an ellipsis if there are further next pages. #}
|
||||
{% if ellipses.next %}
|
||||
<li class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
||||
{% endif %}
|
||||
{# Print next item if we are not on the last page. #}
|
||||
{% if items.next %}
|
||||
<li class="pager__item pager__item--next">
|
||||
<a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
|
||||
<span class="visually-hidden">{{ 'Next page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.next.text|default('Next ›'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{# Print last item if we are not on the last page. #}
|
||||
{% if items.last %}
|
||||
<li class="pager__item pager__item--last">
|
||||
<a href="{{ items.last.href }}" title="{{ 'Go to last page'|t }}"{{ items.last.attributes|without('href', 'title') }}>
|
||||
<span class="visually-hidden">{{ 'Last page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.last.text|default('Last »'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,58 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for status messages.
|
||||
*
|
||||
* Displays status, error, and warning messages, grouped by type.
|
||||
*
|
||||
* An invisible heading identifies the messages for assistive technology.
|
||||
* Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html
|
||||
* for info.
|
||||
*
|
||||
* Add an ARIA label to the contentinfo area so that assistive technology
|
||||
* user agents will better describe this landmark.
|
||||
*
|
||||
* Available variables:
|
||||
* - message_list: List of messages to be displayed, grouped by type.
|
||||
* - status_headings: List of all status types.
|
||||
* - display: (optional) May have a value of 'status' or 'error' when only
|
||||
* displaying messages of that specific type.
|
||||
* - attributes: HTML attributes for the element, including:
|
||||
* - class: HTML classes.
|
||||
*
|
||||
* @see template_preprocess_status_messages()
|
||||
*/
|
||||
#}
|
||||
|
||||
{{ attach_library('basic/messages') }}
|
||||
|
||||
{% for type, messages in message_list %}
|
||||
{%
|
||||
set classes = [
|
||||
'messages',
|
||||
'messages--' ~ type,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{% if type == 'error' %}
|
||||
<div role="alert">
|
||||
{% endif %}
|
||||
{% if status_headings[type] %}
|
||||
<h2 class="visually-hidden">{{ status_headings[type] }}</h2>
|
||||
{% endif %}
|
||||
{% if messages|length > 1 %}
|
||||
<ul class="messages__list">
|
||||
{% for message in messages %}
|
||||
<li class="messages__item">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{{ messages|first }}
|
||||
{% endif %}
|
||||
{% if type == 'error' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{# Remove type specific classes. #}
|
||||
{{ attributes.removeClass(classes) }}
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,41 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a views mini-pager.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: List of pager items.
|
||||
*
|
||||
* @see template_preprocess_views_mini_pager()
|
||||
*/
|
||||
#}
|
||||
{% if items.previous or items.next %}
|
||||
<nav class="pager" role="navigation" aria-labelledby="pagination-heading">
|
||||
<h4 class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
||||
<ul class="pager__items js-pager__items">
|
||||
{% if items.previous %}
|
||||
<li class="pager__item">
|
||||
<a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
|
||||
<span class="visually-hidden">{{ 'Previous page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.previous.text|default('‹‹'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if items.current %}
|
||||
<li class="pager__item">
|
||||
{% trans %}
|
||||
Page {{ items.current }}
|
||||
{% endtrans %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if items.next %}
|
||||
<li class="pager__item">
|
||||
<a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
|
||||
<span class="visually-hidden">{{ 'Next page'|t }}</span>
|
||||
<span aria-hidden="true">{{ items.next.text|default('››'|t) }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user