Custom Dropdownlist and Accessing Property in Razor View
I'm a newbie so apologies if I am asking a daft question. I'm using Umbraco V5.
I have a document type and I want to add a dropdownlist property with a set of pre-defined values. I have created a custom data type, and created the property on the document type in question. I can create a document of that document type and set the property selecting one of the valid values. All ok so far.
When I get to displaying this data in a template, I can't seem to extract this data. I can do so for all other normal data types like textstring etc. The template is allocated to the document type.
This is what my code looks like in my template:
@{var leftMenu = Umbraco.Field("pageSection");}
My property is called pageSection, and this is configured to be a custom dropdownlist (which is called "Page Section DropDownList"). What am I doing wrong? It's bound to be something daft!
Don't worry guys - worked it out. It's difficult getting answers to Umbraco questions - perhaps this one was too obvious that very few people have posted info on the web about it!
Custom Dropdownlist and Accessing Property in Razor View
I'm a newbie so apologies if I am asking a daft question. I'm using Umbraco V5.
I have a document type and I want to add a dropdownlist property with a set of pre-defined values. I have created a custom data type, and created the property on the document type in question. I can create a document of that document type and set the property selecting one of the valid values. All ok so far.
When I get to displaying this data in a template, I can't seem to extract this data. I can do so for all other normal data types like textstring etc. The template is allocated to the document type.
This is what my code looks like in my template:
My property is called pageSection, and this is configured to be a custom dropdownlist (which is called "Page Section DropDownList"). What am I doing wrong? It's bound to be something daft!
Don't worry guys - worked it out. It's difficult getting answers to Umbraco questions - perhaps this one was too obvious that very few people have posted info on the web about it!
The correct code is:
Moderator,
Can you move this to the Umbraco V5 forum please?
Thanks.
Thanks, Nigel! I just had the same problem.
is working on a reply...