- Business Foundation
- Generating typed business foundation classes
- SQL meta-model
- Extending meta-models
- Exporting and importing meta-models
- Working with SQL Records
- Working with entity objects
- Filtering and sorting
- Business meta-model
- Product variants
- Bundles and packages
- Related entries
- Catalog events
- Commerce rendering templates
- Catalog content provider
- Assets and media
- Metadata Plus
- Order system overview
- Order manipulation
- Order processing
- Calculating orders
- Extending order classes
- Changing default implementation
- Rounding totals for different currencies
- Order notifications
- Order events
- Searching for orders
- Order object model and database diagram [Legacy]
- Order management classes [Legacy]
- Order addresses [Legacy]
- Shopping cart [Legacy]
- Checkout process [Legacy]
- Recurring orders [Legacy]
- Changing order number sequence [Legacy]
- Taxes [Legacy]
- EPiServer.Commerce.Sample guideline [Legacy]
- Scheduled Jobs
- Customizing search
- Configuring facets and filters
- Creating a search provider
- Configuring Solr search provider
- Configuring Episerver Find search provider
- Find integration
- Warehouses and inventories
- Workflows and activities
This content is archived. See latest version here.
Last updated: Oct 12 2015
Working with meta-field controls
Meta-field controls are rendered for custom fields. You can see examples of them when you edit an entry or catalog nodes in the Catalog Management subsystem (legacy). This topic explains how to extend and customize meta-field controls.
How it works
Meta-fields are rendered using default controls that are defined in the Admin/Apps/Core/MetaData/Controls/ folder. For example, the meta-field string is rendered using ShortStringControl.ascx.
You may have more specific data entry constraints than the default controls provided. For example, you want to add a custom status text field, and you want to ensure that only specific possible values are entered in that field. You want to keep that field a simple string field (to improve performance) in the database, but also do not want users entering data to add invalid data.
The simplest way to do this is to:
- Create a new custom user control (make a copy of ShortStringControl.ascx).
- Change the textbox to a drop-down control with hard-coded values.
- Make the system automatically pick-up your control instead of the default one. To do that, the name of the control must match the name and metadata type of the meta-field you are mapping the control to. See table and description below.
Another example is when you want to override ImplementationStatus fields with a metadata field type of ShortString.
This can be done as follows:
- Name the control ImplementationStatus.ShortStringControl.ascx.
- Create the ImplementationStatusmeta-field as a Short String in the Catalog portion of the Administration tab.
- Add the field to a meta-class.
When you edit an entry in the catalog with this meta-class (containing the ImplementationStatus field), the field is represented with your custom control.
Note: When you use custom meta-fields (such as year) with search filters in places like the Shopping Options sidebar control, use the Float type instead of Decimal.
The engine lets you override how the meta-field is rendered for the scopes listed in the following table. The position reflects the order engine validating the controls, if the control exists, which renders the field and evaluation stops.
|Specific meta field name in particular meta class||MetaClassName.MetaFieldName.TypeName.ascx|
|Specific meta field name for all meta classes||MetaFieldName.TypeName.ascx|
|Specific meta class||MetaClassName.TypeName.ascx|