Hi! I installed Adaptive Theme on a Drupal 8 site I've been using for testing purposes. I used the theme generator to create a subtheme and the only thing I've really added is a node and a view. However, I noticed that neither page will display breadcrumbs. I've checked to make sure the breadcrumb block is enabled in the Content Prefix region and I have reinstalled the theme and created another subtheme with the generator, but still no changes.
I did notice, through inspecting the page, that the block html is showing on these pages, but without displaying any content. Otherwise, I'm not sure what could be causing this issue to occur.
Comments
Comment #2
tklepsch CreditAttribution: tklepsch at OpenConcept Consulting Inc. commentedComment #3
Jeff Burnz CreditAttribution: Jeff Burnz commentedI think this is a support request, maybe there are no actual breadcrumbs to display, e.g. you don't get a "Home > My Node" type breadcrumb in Drupal, or for a View, such as "Home > My View".
The block code will print (the wrappers) because of this issue: #953034: [meta] Themes improperly check renderable arrays when determining visibility
I am working on a JavaScript solution for layout so we can remove the empty block and region code etc, and set the layout in JS, however that solution is a little slow and creates some flicker as the layout is applied as a behaviour so has to wait until the whole document is loaded.
If you turn on the Forum module and visit it's links, create a forum topic etc, you should see breadcrumbs, the other way to test is to set your theme as the admin theme for a minute and surf around the admin pages, you should see breadcrumbs.
Comment #4
tklepsch CreditAttribution: tklepsch at OpenConcept Consulting Inc. commentedThat is true, a support request would make sense in this situation unless proven to be a bug.
When I enabled the forum module, the breadcrumbs did appear on forum pages and with the markup override: Show the "You are here" label if it is enabled. Although it still doesn't work with other content types.
I changed the theme to Bartik, Stark and Seven, and each would show Home in the breadcrumb on the node and the view. Does Adaptive theme just by default not show Home?
Also, another point to note is when I enable the Adaptive Theme markup override: Show the "You are here" label, that text does not appear as well.
Comment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedHome is hidden by default, however you can turn it on in markup overrides.
Clear the cache if things don't appear strait away, this applies to nearly everything in theme settings, if it doesn't show up strait away, try clearing the cache. The "You are here" is simply hidden in the template and is a very simple TRUE/FALSE condition, to not display is most certainly because all twig templates are cached and you must clear cache to update them.
Comment #6
tklepsch CreditAttribution: tklepsch at OpenConcept Consulting Inc. commentedI have been clearing the cache every time I've made changes within the theme settings, but still nothing shows up. Same when enabling markup overrides, as mentioned previously. The breadcrumb mark up overrides do not work. And this seems to be a specific issue to adaptive theme, not the base themes.
Comment #7
la_gnf_1 CreditAttribution: la_gnf_1 commentedI am having this same issue. Breadcrumbs are not showing up in my development site, not even the 'Your are here' label shows. Doing 'view source' on the page shows that the block div is there, but it is empty.
Comment #8
Jeff Burnz CreditAttribution: Jeff Burnz commentedIt's most likely empty because there are no breadcrumbs. You need to clear the cache if you make a change and it doesn't show up, I might change this to clear the cache by default when you save the theme settings, however this can be a bit slow.
If you think there is genuinely an issue can you give more info, such as the URL you are visiting etc, to test I must be able to replicate exactly what you are doing.
Comment #9
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedI can confirm this is happening when there are breadcrumbs. I set up a local site, standard Drupal installation, no additional modules. I then generated a new subtheme and confirmed the breadcrumbs should display in the content prefix region in block layout. I cleared all cache at admin/development/performance with the subtheme as the default theme, no breadcrumbs appear. I switched the theme back to seven and reloaded admin/development/performance, breadcrumbs appear.
Comment #10
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedLooks like
{% content_prefix.has_regions %}
is returning false in page.html.twig. Moving the breadcrumb block to a different region doesn't change the result.Comment #11
Jeff Burnz CreditAttribution: Jeff Burnz commentedI'm on it, will test shortly, @Richard Buchanan thanks for the screenshots, much appreciated.
Comment #12
Jeff Burnz CreditAttribution: Jeff Burnz commented@Richard Buchanan what version of Drupal are you running? Is it 8.0.2 or a dev version? Also what version of Adaptivetheme - GIT or a dev. Strait off I can't replicate it (I get breadcrumbs), is there anything else you can add so I can try to replicate?
Comment #13
la_gnf_1 CreditAttribution: la_gnf_1 commentedI don’t know if this will help anyone else but here is what I found after posting above then digging a little more. In my case I found my expectations of what the breadcrumbs should do were incorrect.
On a page one level down (mysite.com/page-1) I expected the breadcrumbs to show ‘home > Page 1’. Instead there were no breadcrumbs showing. At two levels down (mysite.com/page-1/page-2) breadcrumbs showed as ‘home > Page 1 > Page 2’ which is what I expected.
at_core.theme has code (line 880 – ‘//If home is the only item, remove it’) that is removing the home link. When I comment out that section of code and run the site, the breadcrumbs behave as I expected/wanted.
Comment #14
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commented@Jeff Burnz Drupal 8.0.2/AdaptiveTheme 8.x-1.x-dev. I used Drush to download AdaptiveTheme, but I can try Git. I'll let you know my results soon. Thanks
Comment #15
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedUsing Git branch 8.x-1.x, I still had no luck. If I turn on the block title display, I do get the block title. But still no breadcrumbs. I will try now on a brand new Drupal install just to make sure there isn't something else I did before that is going on. The current install is a few weeks old, set up for theme development.
Comment #16
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedOkay, breadcrumbs are now displaying on a clean Drupal install.
Drupal 8.0.2
AdaptiveTheme 8.x-1.x (via git)
Not sure what was going on the first time around, but it is definitely not an issue with the theme.
Comment #17
Jeff Burnz CreditAttribution: Jeff Burnz commented@la_gnf_1 you don't need to comment the code to show the Home link, just check the option to show home in Extensions > Markup Overrides > Breadcrumbs
@Richard Buchanan thanks for the feedback, I'm not sure what is going on either - I haven't changed anything recently, a while back I did make the breadcrumbs (and pager) responsive (they change display to stacked if they're too wide for their container). However I'm not sure that would cause the problems you've had.
I'll mark this as fixed for now, if anyone has a problem feel free to re-open it.
Comment #19
PatrickMichael CreditAttribution: PatrickMichael commentedHi all,
Thanks for a great theme.
I am getting the same issue as reported above.
Drupal 8.1.0 and Adaptive theme 8.x-1.x-dev (2016-Apr-25)
This page you will see the breadcrumb block title, but no breadcrumbs :: http://dev.digitalsolace.co.za/content/home-page-leader-0
Breadcrumb settings are enabled in markup overrides
Any help most appreciated
Comment #20
PatrickMichael CreditAttribution: PatrickMichael commentedAdditional information to the above:
Breadcrumbs show on http://dev.digitalsolace.co.za/node/6 (without the page title) but not on the url alias path http://dev.digitalsolace.co.za/content/home-page-leader-0
Comment #21
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commented@PatrickMichael, I'm getting a 404 on the aliased path link you gave.
@Jeff Burnz, which branches of Drupal and Adaptive theme do you prefer us to test against? Breadcrumbs are showing up on my site with aliased paths, but I can test on my local machine as well.
Comment #22
PatrickMichael CreditAttribution: PatrickMichael commentedApologies, i re-built the path aliases : http://dev.digitalsolace.co.za/content/home-page-leader is now correct.
I use the downloads from drupal.org , not the GIT branches.
Comment #23
PatrickMichael CreditAttribution: PatrickMichael commentedNot sure if this is relevant, but the site started as a drupal 8.0.4 install and was upgraded to 8.1.0
Comment #24
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commented@PatrickMichael, Jeff updated the dev branch today, so I cannot go back and pull from the date you downloaded from. I can test this on my local machine, but it will be with today's dev update. Perhaps you can try updating as well?
Comment #25
PatrickMichael CreditAttribution: PatrickMichael commented@Richard Buchanan, thank you, yes i updated to the latest dev earlier today, no change. This is most confusing as if i enable one of the default themes, breadcrumbs show. I also have pathauto installed.
Comment #26
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedI began with a fresh install of Drupal and couldn't reproduce your results Patrick. But I didn't get a crumb trail at all, path aliased or not. The block title is shown, but there is no block content.
Now if I make the at sub-theme for the admin theme and edit the node, the breadcrumb is as expected.
@Jeff Burnz, starting at line 902 of at_core.theme:
...shouldn't we be checking the theme setting
theme_get_setting('settings_breadcrumb_home')
instead of$arr_length ==1
? In fact, I don't see that setting being checked anywhere.Here's a quick patch that gives me the results I'd expect.
Comment #27
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedOops, a little more touchup.
Comment #28
PatrickMichael CreditAttribution: PatrickMichael commented@Richard Buchanan, thank you, this worked for me, most appreciated. Now working on adding the page title to the breadcrumb....
Comment #29
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedYou're welcome Patrick, I updated the status to needs review to wait on feedback.
But if you're having issues with the current page title not showing when set in the theme settings, you'll want to open a new issue.
Comment #30
PatrickMichael CreditAttribution: PatrickMichael commentedThat's just it, I don't see the display page title as an option in Adaptive D8 theme settings, i know it is there in D7 - unless i am missing something!
Comment #31
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedYou know, you're right Patrick. Sorry, was thinking of AT 7.x, which had a setting for appending the page title to the breadcrumb trail.
Still best to create an issue under the "Feature request" category. It will need different logic than this issue presents, and will attract better attention on its own. Especially since it isn't a feature provided by AT 8.x at the time.
Comment #32
PatrickMichael CreditAttribution: PatrickMichael commentedYes, understood, thanks once again for all the help.
Comment #33
Jeff Burnz CreditAttribution: Jeff Burnz commentedThis is a feature of the theme - to remove the home link when it's the only item. I agree this could be made configurable, but I wonder how many people want to show the home link when it's the only item? I'm open for discussion on this.
We do check the home setting using config, in the block of code below, around line 928 (see below) I never use
theme_get_setting()
in preprocess because it's slow, it's faster to use configuration, i.e. you will see in most functions I grab the settings config object:$config = \Drupal::config($theme . '.settings')->get('settings');
Comment #34
Jeff Burnz CreditAttribution: Jeff Burnz commentedI'm a tad confused about how to reproduce the bugs being discussed.
Could you guys give me simple steps to reproduce your error, e.g. install pathauto, then do this etc.
Cheers :)
Comment #35
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedThanks Jeff, I didn't look beyond around line 902 where home is removed when it's the only crumb.
If I'm viewing a node, I expect to see the home link in the breadcrumb since I hadn't set the setting to hide it. There's not always a case where I provide a home link in the main menu, so it's nice to have home in the crumb.
Here's how to reproduce it:
The confusion is coming from #4, since the theme setting simply says "Remove the home link". Since the setting is not set some would expect to still see the home link, even though it's the only crumb.
Hopefully I didn't confuse things more, but I guess we didn't expect the home link to be removed if it's the only crumb.
Comment #36
Jeff Burnz CreditAttribution: Jeff Burnz commented@Richard Buchanan ah, OK, I get it now.
I'll have to alter the theme settings for this, I should NOT hide the home link auto-magically and instead provide a new optional setting to hide Home if it's the only link.
Sound slike I need to clean up the descriptions also so it's not confusing about what is being removed/hidden etc.
Comment #37
Richard Buchanan CreditAttribution: Richard Buchanan as a volunteer commentedThanks Jeff, that sounds like a good option to add! Going back now, wasn't so much a bug as it was a feature request. Haha
Comment #38
Jeff Burnz CreditAttribution: Jeff Burnz commentedWell, bug/feature request it kinda depends how you see it. If the behaviour is very unexpected and unwanted it can be a bug. I knew it would be controversial when I did it, but you have to try things. I frequently code in easter eggs like this and to be frank about 90% of them go unnoticed - because it's just a sensible/preferred way of doing things for 90% of people. I can concede on this one I have got it wrong.
Comment #40
Jeff Burnz CreditAttribution: Jeff Burnz commentedComment #42
giambae CreditAttribution: giambae as a volunteer commentedI am having same issue with Drupal core 8.8.5... I am unable to figure out how to fix it / I am not a code-er so would need some help please