Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By shaunmilo on
At some point near the end of development for my Drupal 8 site, any NEW block placed in a region isn't displaying or being output to the DOM. I place the block in a region, define what pages to display it on, click save blocks and yet nothing shows. I've tried clearing cache multiple times, but no dice.
All of my other blocks are still working (from before this started happening) but I'm afraid that if I remove them and try to re-add those blocks, they aren't going to render anymore. Any ideas?
Comments
are using a custom theme?
are using a custom theme?
did you try putting the block in the main content region?
I like the universe, but she messes with my words
I'm not talking planets or galaxies and the distance just makes it worse.
I know what you're thinking, this probably sounds rehearsed.
Yes, I am using a custom
Yes, I am using a custom theme and yes I've tried placing blocks in the main content region and other default Drupal regions, but they will not appear on the front end :(
im not really sure, since i
im not really sure, since i didnt explore theming yet
are you on the right theme tab?
did you try printing on the region template twigs files?
I like the universe, but she messes with my words
I'm not talking planets or galaxies and the distance just makes it worse.
I know what you're thinking, this probably sounds rehearsed.
Yes, I'm using the right
Yes, I'm using the right theme and I'm creating my regions in the "mytheme.info.yml" file and outputting them in page.html.twig
Show us some code you are
Show us some code you are using, it could be a simple issue, also when you change a template you must clear the cache.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
I know, I've cleared the
I know, I've cleared the cache a million times.
Here's how I have my theme.info.yml file set up:
Let's refer to the "Content Top" region for this example. In page.html.twig, I'm outputting the region like so:
Then, I add a block with some content to the region in Block Layout. However, when I inspect the page, it gets output in the DOM as an empty div with no content:
That looks OK, what about
That looks OK, what about region and block templates? What blocks are you enabling, are standard core blocks working, e.g branding etc?
I suppose I'm asking what you mean by "add a block with some content ".
Are you using a base theme (e.g. Classy?), if not do you have a block or region template in your theme? What do they look like?
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Standard core blocks also don
Standard core blocks also don't seem to display when placed in any region. By adding a block with some content, I mean that I'm simply creating a basic custom block with some dummy text in order to test.
I don't have a base theme defined and I'm not using any custom block or region templates with my theme. Just the default.
However, the blocks are able
However, the blocks are able to display when I switch to the Bartik theme... so there must be something strange happening with my custom theme.
Zip your theme and put it
Zip your theme and put it somewhere we can download it, I'd need to debug it locally.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
So I actually managed to get
So I actually managed to get my blocks/regions working again last night.
For some strange reason, once I switched to the Bartik theme (for debugging purposes) I moved my custom theme's page.html.twig file out of my templates/layout/ directory, cleared cache, moved the file BACK and then re-enabled my custom theme, things randomly started working again. Maybe there was some strange caching issue going on with the server? Who knows...
same problem
I have exactly the same problem, unfortunately on my live site.
The last thing I did was changing the responsive menu configuration of my main menu, then it disappeared.
The solution by shaunmilo doesn't work for me.
It's an AdaptiveTheme subtheme, so Jeff, maybe you can find something?
Even in Bartik, I can't add any blocks.
I still can rearrange blocks in the same region, though.
This is the site: www.mehrweggottesdienst.de
What disappeared?
What disappeared?
Really difficult to diagnose, I'd probably need access to the site etc, feel free to open an issue in the Adaptivetheme issue queue, perhaps we can get to the bottom of it.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
menu disappeared
Sorry, the menu disappeared.
Jeff, feel free to add yourself as a user on www.mehrweggottesdienst.de (unfortunately, the site is in German) - I'll change you to admin ASAP.
I'll open an issue, although I'm not totally sure this is an Adaptivetheme issue, since I can't add blocks in Bartik either.
My problem was fixed.
Just in case anyone reads this thread: My problem was related to Rules and fixed in Drupal 8.2.1
Don't use "Rules" for D8 yet!
Had the same issue, cost me about three days, finally found this thread and uninstalled rules module, what solved the issue.