Hello,

Is there a way to dinamically set the Icon from a variable?
I've found an old solution that implied forcing the class in the extended properties of the Icon with "fa fa-"+the name of the icon.

But this is not working, the Icon simply isn't showing. Is there any work around?


Thanks,

Joaquim

Hi Joaquin,

You can use a IF statement in the screen to define the icon.

The point is to have every single Icon available, so that's not really a practical solution!

Hi Joaquim,

The original solution should work, so if it doesn't (seem to), perhaps there's something wrong with your code?

Sample:



Leandro: like Joaquim wrote, that's not a solution if you have a large number of dynamic icons to support.

Joaquim Mauricio wrote:

The point is to have every single Icon available, so that's not really a practical solution!

Ok, I got it now.


Solution

Hi Joaquim,

I just checked, and it's exactly what we do (Traditional Web):

Where the Static Entity "MainEnergieIcons" contains:

Solution

Kilian Hekhuis wrote:

Hi Joaquim,

I just checked, and it's exactly what we do (Traditional Web):

Where the Static Entity "MainEnergieIcons" contains:

 Thanks a lot, I was messing up, but your example helped me!
Joaquim

 

Glad I could be of help :) Happy coding!