Templating the Color field

The Color field allows content writers to select a color through a variety of color pickers as well as having the option to manually input a hex value.


Here’s an example of how to integrate a Color field into your template.

  • ejs
  • pug
  • pug (API v1)
<h2 style="color:<%= document.data.color %>">Colorful Title</h2>
h2(style="color:" + document.data.color) Colorful Title
h2(style="color:" + document.getColor('blog-post.color')) Colorful Title

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.