-
Notifications
You must be signed in to change notification settings - Fork 58
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 fallback option for custom label #142
Comments
It might also be useful to add a preloader since it might take a few seconds to render the macro for a custom label (depending on the complexity of the macro). |
Hi @bjarnef yes, a fallback label option for all of the label property-editors for when the result set is empty would be really good - want to take it on ? If the macro were to be called for an empty result set, the key and label parameters would be null, so this would be a breaking change, (but the check in macro could be done on the total parameter). I'll create a new issue for the preloader. |
Hi @Hendy Not sure how to solve this, but when Relation Labels https://github.com/uComponents/nuPickers/wiki/Property-Editor-Relation-Labels I noticed to only render the macro when there exists a relation. So any additional static text in the macro partical view doesn't seem to render. |
Hi @bjarnef, Yes that is correct, currently the macro is called for each item in the result set, so if the result set is empty, the macro will not be called. |
Maybe is could use a localized key as a empty/no results text ... or a fallback message from a property config property - however I don't think dictionary items in datatype config are supported in Umbraco. I my package Switcher I solved in like in 4th screenshot by replacing it with the localized value. However solving it in this ways it will probably only display a textstring and not has the option to present it in a other style, e.g. a picker user or member as an empty default avatar: https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&f=y |
The custom labels works very well. However when there is no relation it doesn't seem to render the macro, so you just have a blank value i content section.
If not rendering the macro, when there is no relation, then maybe add an extra property to custom label property editor, where you e.g. can write a fallback message like "There is no relations to any member".
https://our.umbraco.org/projects/backoffice-extensions/nupickers/questionssuggestions/61013-Display-Custom-Label-when-no-item-is-selected
The text was updated successfully, but these errors were encountered: