Field types supported by SuperFields
When you create your metafields definitions, you can choose among different field types. Choosing the appropriate field type is important, as it will help the merchant to more easily edit fields later on.
Here is a description of supported field types:
- One-line text: this is a standard input field. It is useful to enter a few words (like a tag line).
- Multi-lines text: this is displayed as a text area. It is useful to enter some lines of content, where you do not want any formatting (such as HTML links, images...). This can be used for instance for short product features.
- Rich-text: this is similar to the multi-lines text, except that here, the merchant can format the text, add images, videos...
- Color: this field allows to display a color picker selector, similar to the one found in Shopify theme editor.
- Email: this field allows to restrict the field to an email.
- URL: this field allows to restrict the field to a valid URL. Please note that in order to be valid, the merchant will need to enter a URL scheme (http or https). If you do not want such strict validation, you can use the one-line text instead.
- Number: this field allows to restrict to a single number. Please note that fractional values (such as 12.34) are not allowed for this type. Only integers.
- Price: this field allows to enter a price. Internally, SuperFields will transform the entered price to a value that can be later on formatted in Liquid using the money filter.
- Switch (on/off): this field allows to have a simple checkbox. This is useful for "Enable/disable" use-cases.
- Tags: this is similar to the product tags. Internally, SuperFields will separate each tag by a comma, so you will be able to split them in Liquid to display them individually.
- Date: this field displays a date picker. Internally, SuperFields will transform the chosen date to a value that can be later on formatted in Liquid using the date filter.
- Product: this field displays a product picker, which will save the product's handle. This product handle can be used to retrieve a product in Liquid through the usage of the all_products global variables.
- Collection: this field displays a collection picker, which will save the collection's handle. This collection handle can be used to retrieve a collection in Liquid through the usage of the collections global variables.
- Blog article: this field displays a blog article picker, which will save the article's handle. This article handle can be used to retrieve an article in Liquid through the usage of the articles global variables.
- Page: this field displays a page picker, which will save the page's handle. This page handle can be used to retrieve a page in Liquid through the usage of the pages global variables.
- Custom objects: this field allow you to create relationship with a custom type. More info about custom objects can be found by clicking here.