Hello everybody.I have a dropdown list which has 5 possible values.
I would like that it has a default value(not the empty string).Is there a solution for that?I have already tried the solution (How to set default values for properties when creating a new node from document type)
which i found in the forum here but it's for textstrings not for dropdownlist!
Any help would be really appreciated.
Good morning and thanks a lot of for the answers both of you!!
Paul,maybe i wasn't clear enough!Let me explain you that i am not talking about in the razor view.I want the default value in umbraco backoffice!I have created a dropdown list with 5 options and i would like to achieve that, when user creates a new content based on this document type , the dropdown comes up with the default value!
How to set default value for dropdown list
Hello everybody.I have a dropdown list which has 5 possible values. I would like that it has a default value(not the empty string).Is there a solution for that?I have already tried the solution (How to set default values for properties when creating a new node from document type) which i found in the forum here but it's for textstrings not for dropdownlist! Any help would be really appreciated.
Hello John,
I was looking at it a while ago and I think it came down to: you need to make a custom editor:
https://our.umbraco.com/documentation/Tutorials/creating-a-property-editor/
Hi John
If you are talking about in the razor view, I would do it like this:
Where you specify "All", that will be the text for the default value.
If I have missed the point then I'm sorry.
Paul
Good morning and thanks a lot of for the answers both of you!! Paul,maybe i wasn't clear enough!Let me explain you that i am not talking about in the razor view.I want the default value in umbraco backoffice!I have created a dropdown list with 5 options and i would like to achieve that, when user creates a new content based on this document type , the dropdown comes up with the default value!
is working on a reply...