Search code examples
drupal-7view

Override Drupal view field formatting?


I have a content type called "thing". A thing can have a "size", that is either "small", "medium" or "large". For a specific view, I want to change this output to rather say: "100 Square Meters" for small, "200 Square Meters" for medium and "300 Square Meters" for large.

What is the most elegant solution to do this? I don't want any weird if and else logic in my view, or worse yet, use Views PHP. Isn't there any easy way to add a field like this with multiple values, but output it in a certain way for a specific view?

UPDATE

I was considering using this.


Solution

  • You can do that in many ways , the most simple way is to override the template field for that field Check out this tutorial

    One more way using custom_formatters module which let you create custom format using token , which should be simple for you

    If you will do this one time only, better to do with the first way, no need to install module you will use it only for one time