Giorgi625 VIP
Total posts: 632
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: 18 Jan 2021


Sergey
Total posts: 13,744
18 Jan 2021 12:03

You can create array of statuses

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

And then

<div class="<?php echo $s[$this->out]  ?>">
Replay Topic
Uploading
Click here to upload and insert file from you hard drive: (png, gif, jpg, jpeg, zip, txt, rar)
Powered by Cobalt