Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Is it possible to set a default value to a property of a document type?
For example: I have the property to hide an item from the menu in the website (it's a checkbox). Is it possible to set the default value to checked?
Kind regards, Robert
Hi Robert,
you can use the ContentService-Events to do this:
https://our.umbraco.org/documentation/Reference/Events-v6/ContentService-Events
If you will set this property only if the item is brand new, then use the Saving event and the HasIdentity property.
Cheers,
Sören
Hi Robert
Another approach could be to take a look at my package https://our.umbraco.org/projects/backoffice-extensions/switcher where you can choose to set the default / initial value to true (checked/active).
/Bjarne
That looks good! I'm gonna try that, thanks!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Set default value Document type Property
Hi,
Is it possible to set a default value to a property of a document type?
For example: I have the property to hide an item from the menu in the website (it's a checkbox). Is it possible to set the default value to checked?
Kind regards, Robert
Hi Robert,
you can use the ContentService-Events to do this:
https://our.umbraco.org/documentation/Reference/Events-v6/ContentService-Events
If you will set this property only if the item is brand new, then use the Saving event and the HasIdentity property.
Cheers,
Sören
Hi Robert
Another approach could be to take a look at my package https://our.umbraco.org/projects/backoffice-extensions/switcher where you can choose to set the default / initial value to true (checked/active).
/Bjarne
That looks good! I'm gonna try that, thanks!
is working on a reply...