Support from Acquia helps fund testing for Drupal Acquia logo

Comments

star-szr’s picture

Assigned: Unassigned » star-szr
star-szr’s picture

Status: Active » Needs review
FileSize
2.21 KB

Initial patch.

msmithcti’s picture

It looks like since #1687864: Bring theme_breadcrumb() up to WCAG 2.0 AA the separator is added in system.theme.css using a :before pseduo element. This means that when there's more than two items in the list, the separator is shown twice. Here's a patch that fixes that (and simplifies the template in the process).

Other than that, it looks great!

star-szr’s picture

Nice, thanks @splatio!

tlattimore’s picture

The patch from #3 looks good to me. Great catch with the WCAG 2.0 change to this, Splatio.

Great work here guys!

joelpittet’s picture

I removed the is defined wondering your thoughts on this? It's easy to see on the seven theme home page where there is an empty breadcrumbs ol:

  <nav role="navigation" class="breadcrumb">
    <h2 class="element-invisible">You are here</h2>
    <ol>
        </ol>
  </nav>

Otherwise some light cleanup: removed the 'array' wording from the twig docblock and tabbed in the if statement to follow twig coding standards.

jenlampton’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

nikkubhai’s picture

Issue tags: -Twig

#6: breadcrumb-twig-1939066-6.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, breadcrumb-twig-1939066-6.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
Issue tags: +Twig

#6: breadcrumb-twig-1939066-6.patch queued for re-testing.

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC based on #7, I highly suspect random test failures since the tests (still) passed locally.

star-szr’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice, +Needs reroll

This will need a quick reroll now that #1961886: Remove 'help' definition from drupal_common_theme() is in.

star-szr’s picture

Assigned: star-szr » Unassigned
chrisjlee’s picture

Status: Needs work » Needs review
FileSize
2.21 KB

Reroll attempt

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @chrisjlee, back to RTBC!

star-szr’s picture

Issue tags: -Novice, -Needs reroll

Tags.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +needs profiling
joelpittet’s picture

FYI, this one is a bit tricky to profile because the XHProf-kit expects to profile the homepage and breadcrumbs don't show on the homepage.

Changing this line temporarily should do the trick... I'll let you know :)
https://github.com/LionsAd/xhprof-kit/blob/master/find-min-web.sh#L8

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -needs profiling

So yeah that worked from #18

Scenario

Node 1 was a child of node 2 which was a child of node 3
Home > Node 3 > Node 2

Profiled /node/1

Run 1

=== 8.x..8.x compared (51afe7feeb64d..51afe83943a2e):

ct  : 70,222|70,222|0|0.0%
wt  : 351,463|351,161|-302|-0.1%
cpu : 301,675|301,768|93|0.0%
mu  : 16,214,664|16,214,664|0|0.0%
pmu : 16,467,472|16,467,472|0|0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51afe7feeb64d&...

=== 8.x..1939066-twig-breadcrumb-theme compared (51afe7feeb64d..51afe875368e3):

ct  : 70,222|70,308|86|0.1%
wt  : 351,463|351,307|-156|-0.0%
cpu : 301,675|301,735|60|0.0%
mu  : 16,214,664|16,254,648|39,984|0.2%
pmu : 16,467,472|16,507,176|39,704|0.2%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51afe7feeb64d&...

Run 2

=== 8.x..8.x compared (51afe9a0d59b4..51afe9f952272):

ct  : 70,222|70,222|0|0.0%
wt  : 351,859|350,761|-1,098|-0.3%
cpu : 301,583|300,891|-692|-0.2%
mu  : 16,214,664|16,214,664|0|0.0%
pmu : 16,467,472|16,467,472|0|0.0%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51afe9a0d59b4&...

=== 8.x..1939066-twig-breadcrumb-theme compared (51afe9a0d59b4..51afea2244278):

ct  : 70,222|70,308|86|0.1%
wt  : 351,859|351,061|-798|-0.2%
cpu : 301,583|301,383|-200|-0.1%
mu  : 16,214,664|16,254,648|39,984|0.2%
pmu : 16,467,472|16,507,176|39,704|0.2%

http://www.lionsad.de/xhprof-kit/xhprof/xhprof_html/?run1=51afe9a0d59b4&...

star-szr’s picture

star-szr’s picture

Issue summary: View changes

Remove sandbox link

klonos’s picture

...coming from #1843668: Move building of breadcrumb render array from template_process_page() to template_preprocess_page():

Problem/Motivation

Right now, working with breadcrumbs in Drupal is really frustrating. They are not available in the preprocess layer to adjust, and by the time you get to them in the template they have already been flattened into a string. We need to make it easy for front end devs to manipulate breadcrumbs instead of just throwing them out and building their own.

Proposed resolution

Make breadcrumbs into a renderable object or array.

That one was marked as a duplicate in favor of this one here, but I don't speak twig yet so I don't know if the solution offered here will also cover the problem mentioned in the other issue. Anyone care to elaborate?

jenlampton’s picture

After discussing with @joelpittet, this issue is now just blocking #1843668: Move building of breadcrumb render array from template_process_page() to template_preprocess_page()
(not a dupe)

joelpittet’s picture

@klonos thanks for the pointer. They are duping code with the twig, it's just this it the twig conversion, that one does some other useful bits:)

We can just remove the twig parts from the #1843668: Move building of breadcrumb render array from template_process_page() to template_preprocess_page() once this one gets.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Needs a reroll

curl https://drupal.org/files/1939068-twig-theme-image-Reroll-6-comment-14.patch | git a
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2261  100  2261    0     0   1283      0  0:00:01  0:00:01 --:--:--  1449
error: patch failed: core/includes/theme.inc:1887
error: core/includes/theme.inc: patch does not apply
joelpittet’s picture

Status: Needs work » Needs review
FileSize
2.2 KB

Re-roll #14

Status: Needs review » Needs work
Issue tags: -Twig

The last submitted patch, 1939068-25-twig-breadcrumb-theme.patch, failed testing.

jenlampton’s picture

Status: Needs work » Needs review
Issue tags: +Twig
jenlampton’s picture

tried to re-roll again, just for giggles.

jenlampton’s picture

Issue summary: View changes

...adding #1843668 to the "Related" section.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

This was just re-rolled. Still looks good to me, back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/templates/breadcrumb.html.twigundefined
@@ -0,0 +1,23 @@
+    <h2 class="element-invisible">{{ 'You are here'|t }}</h2>

The class has changed to become "visually-hidden" see #1363112: Simplify names of "element-x" helper classes

chrisjlee’s picture

Status: Needs work » Needs review
FileSize
2.2 KB
545 bytes

had five minutes. easy class change. enjoy.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC then

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2c67e90 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

related