I have a database, that lists a number of industries, and also a Font Awesome icon name in the next column.
What I’d like to do within a repeating group is display the appropriately named FA icon in each record.
I’ve tried a few ways now, and wondered if this is possible:
Using the class Toggle - I cannot change the ‘name’ in Class Toggle with a data picker / binding from the DB output
Manually changing the later part of the icon name (e.g. the part after ‘fas’) with the name of the relevant field from the repeat group bindings, e.g.
I’ve tried Dynamic Attributes inner text and inner html - naturally inner text wasn’t going to work, I was optimistic about inner html and used both and tags to reference the FA icon.
As a last resort, I can download the icons themselves and display them that way with a URL, but as we are already using the CDN - this would be a more ideal solution.
In the above case that is is a repeat table, the .concat(icon) is the name of the field from the query and the colour you see is from a DB field in the query called colour.
Thank you @Philip_J, @UKRiggers and @Teodor - haven’t got back to this yet, but I’m grateful for all your responses and will no doubt be able to solve it with your responses.
So is this screenshot from chrome dev tools or something?
It definitely looks like it should work. That FA code is part of the normal free package. Do you have other icons on that page that are working? i.e. are the Font Awesome scripts/files etc being loaded properly on that page?
I tried that code in my own app and it works (i just needed to replace the icon for the text though)...so it would seem its something to do with the dynamic element but based on the rendered code it seems to be working
Thanks @Philip_J - I was concerned it was something else, appears as though it must be. If I use the standard Wappler FA elements, it renders fine on the page - it’s just this dynamic value that isn’t rendering.