I have an extra field selection called "hotel category" with the values "1,2,3,4,5" and I want on the front end instead of showing the numbers show the image with the stars according to the selected number.
I know I can use something like: <
I know I can use something like: <
13 years 6 months ago #112255
Hello Daniel,
this will give you some hints getk2.org/community/New-to-K2-Ask-here-f...K2-after-Item-Fields
this will give you some hints getk2.org/community/New-to-K2-Ask-here-f...K2-after-Item-Fields
Topic Author
13 years 6 months ago #112256
Hi, thanks for your answer but the ink gives a 404 error, anyway I think you meant this:
getk2.org/community/New-to-K2-Ask-here-first/171284-Where- to-edit-K2-after-Item-Fields
But I still do not understand how to show an image according to the number you selected in the field. ?
Some more specific example?
Thanks in advanced.
getk2.org/community/New-to-K2-Ask-here-first/171284-Where- to-edit-K2-after-Item-Fields
But I still do not understand how to show an image according to the number you selected in the field. ?
Some more specific example?
Thanks in advanced.
13 years 6 months ago #112257
You have to check which value is enabled and then show the appropriate image, the example is with one value but you can modify it easily.
It's all in the if else statement.
It's all in the if else statement.
13 years 6 months ago #112258
Say that the field alias is hotel_category, and its values are 1,2,3,4 and 5
And your images names are 1.png, 2.png, 3.png, 4.png and 5.png
and the images relative path is: images/hotelcategory/
in the item.php file, you will insert the following html code in the required position:
Make sure to add it as html code.
It is planned to add this feature to my MEFG plugin, where it will be possible to map select/mutliselect/checkbox/radiobutton field values to images.
And your images names are 1.png, 2.png, 3.png, 4.png and 5.png
and the images relative path is: images/hotelcategory/
in the item.php file, you will insert the following html code in the required position:
<img src="images/hotelcategory/<?php echo $this->item->extraFields->hotel_category->value;?>.png" />Make sure to add it as html code.
It is planned to add this feature to my MEFG plugin, where it will be possible to map select/mutliselect/checkbox/radiobutton field values to images.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store