Hoppa till huvudinnehållet

Display icon in description IF field value is "yes"

Kommentarer

3 kommentarer

  • James Brink
    Suzanne

     

    Did you ever get this to work?

     

    Thanks
    0
  • Permanently deleted user
    I wish, but no. I've since moved on but would still love to make this happen if anybody has a way!
    0
  • Zack Robison
    You can add custom script to your viewer but not through the Rest Manager.  I think that an easier path for you is to hide the icons with CSS, I've done something similiar in the past.

     

    Here's the basic process, using the original post as an example:

     

    1) write the feature description to include both icons

     

    2) write custom css to hide a class, the name of which includes your desired value in the data eg .icon-mtnbike-no { display:none; } 3) add that class to your icons, but replace the text from your data (in this case "no") with the token for that field eg. <img class="icon-mntbike-{usr-type-mtnbike}" src="http://sub.domain.loc/some.img">

     

    Thus you will hide the icon when the data's value is "no".  With further effort, you can do the opposite and only show the icon when the value is "yes" (or whatever value you like) by placing the data token apart from the rest of your custom class and writing an additional rule, so your html looks like class="icon-mtnbike {token}" and your css looks like .icon-mtnbike { display:none; } .icon-mtnbike.yes { display:block; }
    0

Du måste logga in om du vill lämna en kommentar.