Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end output for backgrounds? #17

Open
alkah3st opened this issue Mar 20, 2020 · 7 comments
Open

Front end output for backgrounds? #17

alkah3st opened this issue Mar 20, 2020 · 7 comments
Assignees

Comments

@alkah3st
Copy link

The new Group block sorely needs the ability to attach a background image to it, and this plugin would be a great solution. While it still works within Gutenberg (that is, you can assign gradients, background colors, and background images in the Gutenberg editor), it doesn't output anything on the blocks in the front end. Do I need to do something to initiate that?

@ajitbohra
Copy link
Member

The plugin update is long due pending for compatibility with new changes to the editor. We are working on update that will fix the issue.

@alkah3st
Copy link
Author

alkah3st commented Apr 7, 2020

Good to hear! I wish I could help but my JS skill is not up to snuff. Would be happy to help test, let me know.

@ajitbohra
Copy link
Member

@alkah3st tested on the latest WordPress release group block with background image and its working fine.

May be nested child block background color is overlapping on the image.

@alkah3st
Copy link
Author

alkah3st commented Apr 7, 2020

Let me try downloading the plugin via git rather than the WP repo, because when I apply a background image to a group block (nothing inside it except a Heading or a paragraph), no image is attached in the Dashboard, and nothing is output on the block markup on the front end. Although the image does show as uploaded to the block, in the sense that it's clear I selected an image in the block settings. (I'm on 5.4, and this is using the default TwentyNinteen theme.) Would you like me to send a screenshot?

@alkah3st
Copy link
Author

alkah3st commented Apr 7, 2020

Yeah, if I try to download the plugin from your repo, it looks like I need to do some sort of compilation for it to work. I get errors on every Gutenberg screen:

Warning: filemtime(): stat failed for F:\Websites\redis\wp-content\plugins\block-background/build/script.js in F:\Websites\redis\wp-content\plugins\block-background\block-background.php on line 184

and

Warning: filemtime(): stat failed for F:\Websites\redis\wp-content\plugins\block-background/build/style.css in F:\Websites\redis\wp-content\plugins\block-background\block-background.php on line 192

The version on the WP repo works fine but again it doesn't output anything on any block on the front end, such as the path to the attached image.

@alkah3st
Copy link
Author

alkah3st commented Apr 7, 2020

Here is an example of what I see on my end, using the plugin that's on WP's repo:

https://imgur.com/a/wRhgMeK

@alkah3st
Copy link
Author

alkah3st commented May 20, 2020

So oddly, I did ultimately manage to get the backgrounds to appear by creating an entirely fresh page and starting from scratch.

I think there's something strange going on with existing pages that already have blocks in place. If you publish a Group block but don't have the plugin yet installed, then activate the plugin and try to add a background, none is output on the front end, even though it appears in Gutenberg. Only by adding a background color, detaching the image, and then re-attaching the image can I get it to output the image on the front end. Maybe the way it saves the selection is wonky if the block already pre-exists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants