+ Reply to Thread
Results 1 to 8 of 8

Thread: Change field value to icon?

  1. #1

    Change field value to icon?

    A lot of classified site now use icon for easy and clean look on listing page. For example:
    Room features: they have icons for the following, instead of text they have icons:
    - AC
    - Bathroom
    - Wifi

    Can we achieve the same? I tried to look at template > tpl > field_out_value.tpl. But I don't know know to get the individual key value for the field. (
    Any suggestion?
    Last edited by Wei Hong; May 18, 2019 at 07:43 AM.

  2. #2
    individual key this FIELD KEY

  3. #3
    All field keys you can find in AP >> Listing Fields and on edit page, you can see field key.
    Viktor,
    Flynax technical department,
    Best wishes.

  4. #4
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    Quote Originally Posted by Wei Hong View Post
    Can we achieve the same? I tried to look at template > tpl > field_out_value.tpl. But I don't know know to get the individual key value for the field. (
    Any suggestion?
    To show icons instead of field labels you should go to field_out.tpl and change the code:
    Code:
    Only registered members can view the code.
    to:
    Code:
    Only registered members can view the code.

  5. #5
    Quote Originally Posted by Vitalik Alekseev View Post
    individual key this FIELD KEY
    I'm sorry I'm not quite following your clue

    Quote Originally Posted by Viktor View Post
    All field keys you can find in AP >> Listing Fields and on edit page, you can see field key.
    Yes Viktor, but it only for the field label, not the value. I made a data entries key "feature" then add a few entries there. Then in listing fields I make a checkbox field "feature" and link it to the data entries features so I have

    Feature:
    - Free wifi (key: wifi)
    - AC (key: ac)
    - Parking (key: parking)
    - Swimming Pool (key: swm_pool)

    Quote Originally Posted by Rudi View Post
    To show icons instead of field labels you should go to field_out.tpl and change the code:
    Code:
    Only registered members can view the code.
    to:
    Code:
    Only registered members can view the code.
    Thanks Rudi this allow me to change the fields label but is there anyway to change the field value as well for example the checkbox fields value as I mentioned above?

  6. #6
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    Quote Originally Posted by Wei Hong View Post
    Thanks Rudi this allow me to change the fields label but is there anyway to change the field value as well for example the checkbox fields value as I mentioned above?
    Ok, I understand now your idea,

    if you need to change checkbox values in field_out_value.tpl change the following:

    Code:
    Only registered members can view the code.

    to:
    Code:
    Only registered members can view the code.
    * Note that field item keys are called by index number

    for example, if your field key is 'features' its first item key will be 'features_1' according to the order in 'Field options'
    Last edited by Rudi; May 20, 2019 at 04:31 AM.

  7. #7
    Quote Originally Posted by Rudi View Post
    Ok, I understand now your idea,

    if you need to change checkbox values in field_out_value.tpl change the following:

    Code:
    Only registered members can view the code.

    to:
    Code:
    Only registered members can view the code.
    * Note that field item keys are called by index number

    for example, if your field key is 'features' its first item key will be 'features_1' according to the order in 'Field options'
    Thanks Rudi, it works greeat for checkbox field. Is there anyway if I could do the same for radio field?
    Like in field_out_value.tpl

    {elseif $item.Key == 'gender' && $item.value.Key == 'gender_male'}
    <img>...</img>
    {else}
    <span>{$item.value}</span>

    {/if}

  8. #8
    Flynax developer Rudi's Avatar
    Join Date
    Dec 2014
    Location
    Planet Earth
    Posts
    3,138
    in this case you should put the following after {elseif $item.Condition == 'isUrl'} section:

    Code:
    Only registered members can view the code.

+ Reply to Thread