Developer forum

Forum » Templates » Get field dropdown list options from Item Type via API

Get field dropdown list options from Item Type via API

António Ramos
Reply

Hi guys,

It's is possible via API to get the fields from a dropdown list? I want to display this information in a razor template for the user select one option.

I tried with the ItemManager.Metadata but i got no success.

Best regards.

António Ramos

getDropdownFields.png

Replies

 
António Ramos
Reply

bump

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Antonio

You can take a look at the item type like this:

Dim it As Dynamicweb.Content.Items.Metadata.ItemType = Dynamicweb.Content.Items.ItemManager.Metadata.GetItemType("some")
For Each f As Dynamicweb.Content.Items.Metadata.ItemField In it.Fields
 For Each opt As Dynamicweb.Content.Items.Metadata.FieldOptionMetadata In f.Options.Values
  Dim name = opt.Name
  Dim value = opt.Value
 Next
Next

Votes for this answer: 1
 
António Ramos
Reply

Thks Nicolai

Best regards,

António Ramos

 

You must be logged in to post in the forum