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

Add fallback option for custom label #142

Open
bjarnef opened this issue Jul 5, 2016 · 5 comments
Open

Add fallback option for custom label #142

bjarnef opened this issue Jul 5, 2016 · 5 comments

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Jul 5, 2016

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

@bjarnef
Copy link
Contributor Author

bjarnef commented Jul 11, 2016

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).

@Hendy
Copy link
Contributor

Hendy commented Jul 11, 2016

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.

@bjarnef
Copy link
Contributor Author

bjarnef commented Jul 12, 2016

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.

@Hendy
Copy link
Contributor

Hendy commented Jul 12, 2016

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.

@bjarnef
Copy link
Contributor Author

bjarnef commented Jul 12, 2016

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.
https://our.umbraco.org/projects/backoffice-extensions/switcher/

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

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

No branches or pull requests

2 participants