Giorgi625 VIP
Total posts: 655
11 Jan 2021 12:48

So this is code from output template of status field.

<span id="field_<?php echo $id;?>" class="pull-left "><?php echo $this->out;?></span>

I want to display only text as status like it is on this page... in image like red button but when status changes want to change background color. I wanted to copy echo code of value inside class andwould get different classes for different values but problem is that I do not use latin characters for values so it will not work.

Do you have any suggestions how to change class when status changes?

Last Modified: 01 Sep 2021

Total posts: 13,748
18 Jan 2021 12:03

You can create array of statuses

$s = [
    'статус1' => 'classname'

And then

<div class="<?php echo $s[$this->out]  ?>">
Powered by Cobalt