I am (perhaps incorrectly, is there a better way?!) trying to produce a result that requires phpPHP code to evaluate whether a Drupal 8 node field is a "x", an "f", a "m", a "h", or an "l".
Thanks to some help on an earlier question, I've accomplished my task (to replace the value with a useful icon) when the value is binary: ifif it exists, show this. IfIf it's empty, show nothing. I'veI've done this via CSS.
Now I'd like to extract the actual value of the node field (I hope I'm explaining this right), and display different icons based on its value.
I am not planning to do this via a function, but rather by code on the node itself. Is there some syntax I can use within the php that will extract this? So that I can have the equivalent of:
$price = $node[field][value];
$price = $node[field][value];
then I'd do:
if $price = "m" {use icon X} else if $price = "h" {use icon Y};
if ($price == "m") { // use icon X }
else if ($price == "h") { // use icon Y };
Thank you for any and all help/suggestions!