2.C. Reference: Schema Format Types

Output formats are used to display the correct representation of a value. If you can’t find the format you need, you can create a custom format with Custom Format. This accepts all the Handlebars Helpers.

2.C.1. Lower Case

Lower Case

Transforms the value to lower case.

Foo Bar -> foo bar

2.C.2. Upper Case

Upper Case

Transforms the value to upper case.

Foo Bar -> FOO BAR

2.C.3. Capitalize

Capitalize

Capitalizes the value.

foo bar -> Foo Bar

2.C.4. Character Length

Character Length

Limits the value to the specified amount of characters

Given that length is 5
foo bar -> foo b

2.C.5. Word Length

Word Length

Limits the value to the specified amount of words

Given that length is 1
foo bar -> foo

2.C.6. Date Format

Date Format

Formats the value to a specified date format

Given that the format is F d, Y
2018-01-01 -> January 01, 2018

2.C.7. Relative Format

Relative Format

Formats the value to a specified relative date format

Given that the format is F d, Y
2018-01-01 -> 3 months ago
Given that the format is F d, Y
2016-01-01 -> January 01, 2016

2.C.8. Raw HTML

Raw HTML

If the value contains HTML, by default we escape these tags. This format will allow the use of HTML as an output

2.C.9. Strip HTML

Strips HTML from the value

Given that allowable is ‘
<p>something <b>strong</b> happened</p> -> something <b>strong</b> happened

Strip HTML

2.C.10. Markdown

Markdown

If the value contains Markdown, this will convert it to HTML.

Link

Converts value to a link tag. The first parameter is the value of the href attribute of the link tag. The second parameter is for the inner text of the link tag.

<a href="/some/link">Foobar</a>

Both parameters can optionally accept Handlebars variables. Handlebars variables are relative to the model that is using this format.

For example if article and has field called title
/some/path/{{article_title}}

2.C.12. Image

Image

Converts a value to an image tag.

Given width is 100 and height is 200
<img src="/some/path/{{value}}" width="100" height="200" />

2.C.13. Email

Email

Converts value to an email link.

Given john@doe.com and Foobar
<a href="mailto:john@doe.com">Foobar</a>

2.C.14. Phone

Phone

Converts value to an email link.

Given 555-2424 and Foobar
<a href="tel:555-2424">Foobar</a>

2.C.15. Formula

Formula

Compiles the given Handlebars template and evaluates the final formula.

Given

  • product has price and tax
  • price is 100
  • tax is 20
{{product_price}} + {{product_tax}} -> 100 + 20 -> 120

2.C.16. Comma Separated

Lower

Joins an array into a comma separated string

2.C.17. Price Format

Lower

Adds commas and 2 decimal places to the number value

2.C.18. Yes/No

Lower

Transforms the value to either Yes or No.

1 -> Yes
0 -> No

2.C.19. Custom Format

Custom Format

Compiles the given Handlebars template.

Given

  • product has name and price
  • name is iphone
  • price is 1000
{{product_name}} - ${{product_price}} -> iphone - $1000

2.C.20. Dont Show

Dont Show

Hides the value

2.C.21. No Filter

No Filter

Performs no formatting on the value