Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By lukejoliat on
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
Basic programming
Well it's either some PHP string function or comparison in preprocess, or use comparison in twig: http://twig.sensiolabs.org/documentation
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.