Commit 2c67e901 authored by alexpott's avatar alexpott

Issue #1939066 by joelpittet, chrisjlee, Cottser, splatio, jenlampton: Convert...

Issue #1939066 by joelpittet, chrisjlee, Cottser, splatio, jenlampton: Convert theme_breadcrumb() to Twig.
parent 0360c07e
......@@ -1835,27 +1835,6 @@ function theme_image($variables) {
return '<img' . new Attribute($attributes) . ' />';
}
/**
* Returns HTML for a breadcrumb trail.
*
* @param $variables
* An associative array containing:
* - breadcrumb: An array containing the breadcrumb links.
*/
function theme_breadcrumb($variables) {
$breadcrumb = $variables['breadcrumb'];
$output = '';
if (!empty($breadcrumb)) {
$output .= '<nav role="navigation" class="breadcrumb">';
// Provide a navigational heading to give context for breadcrumb links to
// screen-reader users. Make the heading invisible with .visually-hidden.
$output .= '<h2 class="visually-hidden">' . t('You are here') . '</h2>';
$output .= '<ol><li>' . implode('</li><li>', $breadcrumb) . '</li></ol>';
$output .= '</nav>';
}
return $output;
}
/**
* #pre_render callback to transform children of an element into #rows suitable for theme_table().
*
......@@ -3146,6 +3125,7 @@ function drupal_common_theme() {
),
'breadcrumb' => array(
'variables' => array('breadcrumb' => NULL),
'template' => 'breadcrumb',
),
'table' => array(
'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'responsive' => TRUE, 'empty' => ''),
......
{#
/**
* @file
* Default theme implementation for a breadcrumb trail.
*
* Available variables:
* - breadcrumb: Breadcrumb trail items.
*
* @see template_preprocess()
*
* @ingroup themeable
*/
#}
{% if breadcrumb %}
<nav class="breadcrumb" role="navigation">
<h2 class="visually-hidden">{{ 'You are here'|t }}</h2>
<ol>
{% for item in breadcrumb %}
<li>{{ item }}</li>
{% endfor %}
</ol>
</nav>
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment