Giorgi625 VIP
Total posts: 655
11 Янв 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?

Последние изменения: 01 Сен 2021


Sergey
Total posts: 13,748
18 Янв 2021 12:03

You can create array of statuses

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

And then

<div class="<?php echo $s[$this->out]  ?>">
Работает на Cobalt