I created a field called grade, for a student content type.

This field is an integer field that goes 0 - 12.

It later came up that my client wants to display the 0 as a k. I wanted to know if there was an override function I can use to check if the field value is 0 for a particular node, and if so, display a k instead of a 0.

Comments

Jeff Burnz’s picture

Well it's either some PHP string function or comparison in preprocess, or use comparison in twig: http://twig.sensiolabs.org/documentation