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
I am trying to list all values form a DropDownMultiple with razor. But without any luck. Using Umbraco7.1
I am quit confused regarding the textstring alias / ID
Can anyone show me the snippet?
Thanks.
Hi Anders,
I have this documentation in process (these are the snippets from it) :-)
Here's what you need:
Dynamic
@{ if (CurrentPage.HasValue("superHeros")) { <ul> @foreach (var item in CurrentPage.superHeros.Split(',')) { <li>@item</li> } </ul> } }
Typed
@{ if (Model.Content.HasValue("superHeros")){ <ul> @foreach(var item in Model.Content.GetPropertyValue<string>("superHeros").Split(',')) { <li>@item</li> } </ul> } }
Jeavon
Ah wait, do you mean Dropdown List, Publish Keys?
Hi Jeavon
And thanks for quick response :-)
Sorry if Im not making myself clear. I would like tol list: All values from a data type. ALL PREVALUES
I am not aware of the therm Publish Keys
Thanks
/Anders
Ok, how about this:
@{ var dts = ApplicationContext.Current.Services.DataTypeService; var prevalues = dts.GetPreValuesByDataTypeId(1125); foreach (var prevalue in prevalues) { <p>@prevalue</p> } }
YES YES. THANKS
But how will i be able of finding/see the ID besides going into table?
THANKS
When you edit the data type you can see it's id in the address bar :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting preValues form custom data type (DropDownMultiple) with razor
I am trying to list all values form a DropDownMultiple with razor. But without any luck. Using Umbraco7.1
I am quit confused regarding the textstring alias / ID
Can anyone show me the snippet?
Thanks.
Hi Anders,
I have this documentation in process (these are the snippets from it) :-)
Here's what you need:
Dynamic
Typed
Jeavon
Ah wait, do you mean Dropdown List, Publish Keys?
Hi Jeavon
And thanks for quick response :-)
Sorry if Im not making myself clear. I would like tol list: All values from a data type. ALL PREVALUES
I am not aware of the therm Publish Keys
Thanks
/Anders
Ok, how about this:
Hi Jeavon
YES YES. THANKS
But how will i be able of finding/see the ID besides going into table?
THANKS
When you edit the data type you can see it's id in the address bar :-)
is working on a reply...