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

Document how to set the default value on a property editor #2407

Closed
PeteDuncanson opened this issue Mar 30, 2020 · 7 comments
Closed

Document how to set the default value on a property editor #2407

PeteDuncanson opened this issue Mar 30, 2020 · 7 comments

Comments

@PeteDuncanson
Copy link
Contributor

See umbraco/Umbraco-CMS#7859 for details of the origin of this one. Seems you can set default values via code but the only reference to it seems to be a video by Paul Seal. If that is the case then we should really get that documented in the offical docs.

Love your work.

@nul800sebastiaan
Copy link
Member

Yep, that would be a great idea, if anyone is up for helping out on this that would be lovely! 👍

@umbrabot
Copy link

Hi @PeteDuncanson,

We're writing to let you know that we've added the Up For Grabs label to your issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly PR team bot :-)

@ronaldbarendse
Copy link
Contributor

The documentation already contains an example on how to set a 'default' value: https://our.umbraco.com/documentation/reference/events/EditorModel-Events/. I've added the quotes around default, as it actually resets the value whenever it's cleared. This example also has a lot of bugs/quirks, as it only sets the value for the first variant/language and throws exceptions whenever the tab or property alias isn't found (e.g. when it's renamed).

Maybe the documentation can be updated with the example I posted in umbraco/Umbraco-CMS#7859 (comment) and/or we can make the whole process a lot easier by adding some helper methods...

@sofietoft
Copy link
Contributor

Hi guys!

The EditorModels-Events article has been updated to use ContentSavedState.
Also, some additional meta-data has been added to the article, making it hopefully easier to find it through search!

Would one of you be up for verifying, whether that update "solves" this Issue? 😄

@ronaldbarendse
Copy link
Contributor

The new sample code and the comments look good, so this issue can be closed IMO!

@sofietoft
Copy link
Contributor

Thanks for checking @ronaldbarendse ! 💪

I'll consider this one closed for now then.
Please feel free to re-open, should something come up.

Have a fab' day!

@ronaldbarendse
Copy link
Contributor

For reference, this issue is related to #2577.

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

No branches or pull requests

5 participants