I believe labels (for blocks) should default to their content type, if the user-provided angular expression results in a null or whitespace. #14811
markadrake
started this conversation in
Features and ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The default behavior of a block is to use its
content typeas the label.The following screenshots show the default configuration of any block you would add, and the resulting label value in a block list.
Is there any reason why somebody would
desire a blank label?
Now, let's set a custom label to our block. We'll use something that we know results in
nullorempty, and see what the editor's experience is like.If the
angular expressionresults innullorwhitespaceI propose we default the label back to its
content type.In a recent project, I had to go back through (approaching ~40) various block settings and append
|| $contentTypeto the end of each angular expression. While this approach worked for most of my blocks, it doesn't work when the values returnwhitespace, such as the example below.If my proposal is not clear,
nullwhitespaceThen, the above example could be simplified to just:
...and work.
Beta Was this translation helpful? Give feedback.
All reactions