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

[UX] Allow non-reusable custom blocks created in Layouts to have an admin label #1703

Closed
klonos opened this issue Mar 10, 2016 · 19 comments
Closed

Comments

@klonos
Copy link
Member

klonos commented Mar 10, 2016

As per issue title. According to @jenlampton in #1522 and #1523, there must have been a field there available for setting an admin title. I don't see any such field any more. Regression perhaps?


PR by @klonos: backdrop/backdrop#1729

@klonos
Copy link
Member Author

klonos commented Aug 3, 2016

The goal here is to be able to leave the block title empty (so that nothing is shown on the frontend), but have a custom block admin UI title that makes each block distinguish-able from the rest when editing a layout that has many custom blocks for example.

I would like to address that issue, but I don't know where to start. Any pointers?

@klonos
Copy link
Member Author

klonos commented Aug 3, 2016

...when I say I want to address the issue, mean start a PR that solves the issue in core.

I have a workaround already: enter in the block title field whatever is desirable for an admin label (in the layout admin UI) and then use CSS to hide it from the frontend.

This addresses the use case of needing an admin label for custom blocks while hiding it in the front end. If one needs a different title shown in the frontend than the one used as an admin title, then I guess they can use the CSS content property.

These are only workarounds though (rather "hacky") and this should be resolved in core by having separate fields for admin label and frontend title.

@Dinornis
Copy link

Dinornis commented Jan 8, 2017

@klonos This may have been fixed in 1.5.
The current Add custom block form includes an Admin label field and the Display title field is optional.

The Add block "Custom block" form available on the Manage Block pages in Layouts has an optional Admin label field available on the form when the Make this block reusable check box enabled.

@klonos
Copy link
Member Author

klonos commented Jan 8, 2017

Nope, still not fixed. To reproduce, add two custom blocks in any layout and leave their "Display title" field empty (that defines the title the block will have in the front-end). Notice how both blocks have "Custom block" as title in the admin UI.

@Dinornis
Copy link

Dinornis commented Jan 8, 2017

Sorry, I was referring to the no way to customize that part of the title.

@jenlampton
Copy link
Member

Maybe the problem only occurs for blocks that are not made reusable?

@Dinornis
Copy link

Dinornis commented Jan 8, 2017

Yes, making the blocks reusable is sort of workaround.
Seems like adding a required Admin label field to the Add block "Custom block" form and removing the field that is hidden by the Make this block reusable option would be a good way to solve this?

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

Maybe the problem only occurs for blocks that are not made reusable?

Yes, precisely. I think that we have the following options here:

  1. Make the Admin label field always available no matter if the "Make this block reusable" option is checked or not (what @Dinornis has already suggested above).

  2. Set the block content as the block admin preview. This would mostly "automate" things compared to option 1 that would require the user to enter an admin label.

I have cooked something like that already, screenshots upcoming...

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

Here's what a series of custom blocks would look like currently ...all in the "Bottom" region; none of them has a title (it falls back to "Custom block") and all of them have the same admin preview. No way to tell which is which:

backdrop-issue1703-custom_blocks_with_no_titles

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

...here's what it could look like with the block content rendered as their admin preview:

backdrop-issue1703-custom_blocks_with_their_content_as_admin_preview

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

The first custom block has no title and no content. In such cases, the custom blocks are rendered as currently. You cannot tell them apart, but I see no reason why people would have more than one such "empty" custom block in their layouts. So edge case.

The 2nd one and all bu the 3rd one have content, but no title. See how easy it is to tell? 😉

The 3rd one has a title, but no content. In such cases, the stock block type description is displayed as admin preview, but the block title is in the form of "Custom block: %block_title%".

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

...I wanted to post a few more screenshots of some thoughts and issues I've had, but since you reacted lightning-fast with a ❤️ @jenlampton, I'll go ahead and file a PR with what I have and then post those...

@klonos
Copy link
Member Author

klonos commented Jan 9, 2017

Alright, I have put an initial PR up for review. There's things to consider still...

  1. What happens if the custom block has a really long text (especially when placed in a narrow region like a sidebar)? I have already tried trimming the content, passing it trough backdrop_html_to_text and also a combination of these, but I had no good results. (more on that as well as screenshots after I get some 💤 )

  2. Do we want to make any other block types output their content as admin preview? I think not, but might be missing something.

  3. Need to test how this PR works with custom blocks that are turned to reusable.

@Dinornis
Copy link

Dinornis commented Jan 9, 2017

I like the idea of using the block content in the block preview on the layout page, but I think it should be optional.

I would like to have the Admin label field available on the Add block "Custom block" form even if not required. This would allow me to identify the custom blocks easier without the need to see their content.

@Dinornis
Copy link

Dinornis commented Jan 26, 2017

The title and description of this issue is correctly identifying a problem of a missing Admin label for non-reusable Custom blocks. The current PR is not addressing the problem of the unavailable Admin label, but rather adding a feature that makes the Block content visible on the Manage Blocks page. That feature is being worked on in the #2288 issue.

As per issue title. According to @jenlampton in #1522 and #1523, there must have been a field there available for setting an admin title. I don't see any such field any more. Regression perhaps?

On the Add block "Custom block" form at /admin/structure/layouts/manage/home/blocks form the Admin label field is only available to the user when they check the Make this block reusable box.

So perhaps this is a regression as the Admin label is available only for reusable blocks.

I would like to address that issue, but I don't know where to start. Any pointers?

@klonos It seems to me that the best solution would be to make the Admin label available even if the Custom block is not reusable.

@Dinornis
Copy link

@klonos Perhaps something like [UX] Make Admin Label available also for not reusable Custom Blocks would be a better title for this issue?

@ghost
Copy link

ghost commented Aug 21, 2020

It looks like this has been fixed already:

image

@ghost ghost closed this as completed Aug 21, 2020
@ghost
Copy link

ghost commented Aug 21, 2020

Oh, I see. This issue is about custom blocks created via the Layouts UI, that aren't reusable...

image

@ghost ghost reopened this Aug 21, 2020
@ghost ghost changed the title [UX] All custom blocks with no display title have "Custom block" as admin title and no way to customize that. [UX] Allow non-reusable custom blocks created in Layouts to have an admin label Aug 21, 2020
@ghost
Copy link

ghost commented Aug 21, 2020

Closing as a duplicate of the more general #4558

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

Successfully merging a pull request may close this issue.

4 participants