-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add a preview of the background image to Hero block configuration forms #6736
Comments
I've pushed a PR for this, but unfortunately it doesn't show an image for the out of the box hero block. This is because there is no hero block background image out of the box, and Basis theme just has a CSS image that it applies to hero blocks with no background. |
What do you think about adding the CSS image also to the Seven theme in this case? |
@docwilmot Great idea to add preview. |
The PR has some phpcs coding errors. |
I know, but my idea was: If the Seven theme uses somehow the CSS image definition from Basis for blocks without background image, the CSS image could also show up in the preview when you use Seven as admin theme and edit a block without background image. Not sure if something like this would work. |
Its reasonable I agree to assume that if the front theme is Basis or a subtheme thereof and there is no image then Basis CSS background may be being applied in the front end, but that may be a fragile plan because we couldnt be sure if the CSS was overridden, in a subtheme. And then we'd need to include an image in Seven thats only used for a particular front end theme. Doesnt all sound right TBH. |
I would vote against adding the Basis hero image to the Seven theme. |
This is a nice little improvement. The overall approach looks good to me, I left a few suggestions in a review: backdrop/backdrop#4898 (review) |
More than one person has told me that they did not realize that they could replace the default image. I think that this PR will improve that situation! |
@stpaultim Unfortunatly, the PR doesn't improve the particular situation with the default image, see #6736 (comment):
|
One issue though is that we cannot know what the image will look like on the front end theme, after that theme's CSS alters the image and the block. I think its clearer to show what the native image looks like rather than cropping and forcing a landscape image. Its not a preview of the hero block, its a preview of the image. |
The current code shows nothing if there is no background image; could we instead of that, show a message saying "No image uploaded, some themes may define the background image in CSS" or something such? Or maybe even just blatantly say, if Basis is front end, "Basis uses a CSS image" or such? |
Your suggestion of adding some text when there is no default image would be an improvement. I think we could also display a small thumbnail that represents the current backdrop texture, when there is no image available. I recommend one of those two options - UNTIL we build agreement on my preferred solution, which is adding a new default image to Backdrop to celebrate the 30th release. I opened a new issue for that discussion to avoid bikeshedding specific images in this issue - or getting sidetracked discussing whether or not that is even a good idea. This current PR is a good idea either way. |
Unfortunately there is no Backdrop texture, only a Basis texture. See #6736 (comment). |
The PR actually does display a thumbnail, but the "medium" size, not the "thumbnail" size. |
I went ahead and added the browse button to this PR. Easily removed if there is disagreement but I think it belongs. |
I understood that, but could have been clearer. My point was that we could create a thumbnail of the texture that is ONLY used to represent what is being displayed, even though it is not an image. I prefer the idea of adding a new default image. EDIT: Sorry, I realize now that the texture is defined by the theme and if Basis is not the active theme, our fake thumbnail would not be accurate. So that idea does not work. In this text: "No background image is currently set. Some themes, such as Basis theme, may display a background image defined in CSS." Possible alternative wording (3 words removed): "No background image is set. Some themes, such as Basis, may display a background defined in CSS." I like the idea of adding the "Existing File" option. |
I think the longer text is helpful. It is educational in that it teaches/reminds people that images can reside elsewhere, e.g. in the theme css. |
PR updated. As usual I cannot reliably advocate, since I'm usually at work during meetings, but I'm happy to be the advocate, so can this get a milestone please? |
Description of the need
There is no preview of the background image of Hero blocks in the block configuration forms.
At least one user reported not realizing that the background image was configurable. This might help.
Proposed solution
Add a preview of the background image to Hero block configuration forms.
Additional information
Backdrop v 1.29.1
Draft of feature description for Press Release
Backdrop now includes a preview of the background image of Hero blocks in the block configuration forms
The text was updated successfully, but these errors were encountered: