Using Umbraco’s Dropdown Datatype

Posted by MightyZot on Geeks with Blogs See other posts from Geeks with Blogs or by MightyZot
Published on Thu, 09 Dec 2010 06:06:42 GMT Indexed on 2010/12/09 22:14 UTC
Read the original article Hit count: 489

Filed under:

In Umbraco, you could consider document types like models and data types as property types for those modes. For example, you may create a document type called “Prices” to represent a page that displays a list of prices. And, then, you might create a document type called “Price Item” to represent the price list items. A property called “Price” could then represent the price of an item. When you create the Price property, you specify the data type, which in this case might be “Number”, indicating that this particular field accepts only numerical values. Consequently, you could also create a drop down list property called “Category”, allowing you to categorize the items in your price list.

imageTo add items to the drop down list, you modify the data type definition in the Developer module of the Umbraco administrative utility. Instead of modifying the drop down data type itself, you should first make a copy by right-clicking on the Data Types node and choosing Create. Give your new data type a name in the Create dialog and click the Create button.

image

In the Edit datatype dialog, change “Render control” to “Dropdown list”.  To add your list items, simply enter that value into the textbox next to “Add prevalue” and click Save or press the Enter key.

Now that you have a new drop down list data type created, along with assigned list items, you can use it in your document type definitions just like you would the other data types.

© Geeks with Blogs or respective owner