I would like to display comment status, which renders "Read/Write" / "Disabled" / "Read Only". I would like to alter those to "Open" / "Locked" / "Locked", or perhaps even icons (such as in forum software).

Is there a way to change the output of field with PHP input?

Comments

dawehner’s picture

No, but you could override the field handler via hook_views_data_alter

Cory Goodwin’s picture

Thank you.

merlinofchaos’s picture

Status: Active » Fixed

For something this simple you could change the output in the field template. Just compare $output to the value that it is currently and actually print your new value instead. Something like this:

  if ($output == t('Read/Write')) {
    print t('Open');
  }
  else {
   print t('Locked');
  }

See Theme: Information to determine which template to use.

Cory Goodwin’s picture

Thank you Merlin.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.