darkhoros VIP
Total posts: 152
19 Май 2015 13:35

Hi, I need to modify the field type image with temaplt list-simple-one.php, lets say I have a select list with value= sale or rent, I like my image filels to be able to know the value of the text field, and if value = sale then I will make the templte to show the word sale above the image and if text field value = rent I will show the word rent above the image, so my question is how do I get to know the text field value and depending of the value render deffrent style, I need the if statment to use to get the field value and I will do the rest.

Is that possible. Thank you.

Последние изменения: 20 Май 2015

Метки Developer


Sergey
Total posts: 13,748
19 Май 2015 16:48

That depends what template you are editing. If you are editing articles list or full article template, you can get access to individual field values through.

$item->fields_by_id[10]->value;

If you are trying to add this flag in image output template, then

$fields = json_decode($record->fields, true);
echo $fields[10];

darkhoros VIP
Total posts: 152
20 Май 2015 10:24

Hi, Thank you i will try this and confirm.

Работает на Cobalt