Hi guys, as many of you asked, here is a short code snippet which you can use to change the color of tags in our dynamic blocks. You need to add it to the page Settings → Custom Code → Header (please make sure to make the corresponding code changes of tag names before applying this code)
This does not seem to work for me any longer. Worked until a few days ago - maybe it has something to do with an update to an update to the list block? Is there a way to fix this - or is it just at my end it has stopped working?
Hi @artur & @Suzie & @Marine.Hovhannisyan - can you please share the updated custom code based on the new table block update? We use the ‘tag’ system to link to formula text fields in airtable and use softr.io to display the tag as a ‘x’ colour based on the exact text. Thanks!
Hi @artur. Can you provide versions of this formula for list and list details blocks as well please? I have the same need for coloring tags from formula field values in tabs and modals with other dynamic blocks as well.
Hi @jak, on the new blocks you can change the tag color of inline filters and fields from the block settings.
If you’re using the new Beta blocks, you can find the tag field or inline filters settings in the block settings → styles panel.
If you’re using non-Beta blocks, you can find the settings on pencil icon of each field.
For my use case, what I am wanting to do is have different tag colours for different statuses. These are formula fields in Airtable. I was using the custom code above in the header of the page to achieve this. But in the Beta blocks it stopped working.
In the ‘Styles’ panel I tried the three options (Single, as defined in data source & the colorful one(?)) but none seem to work with the custom code.
Hi @jak. It’s not uncommon for custom codes to break overtime or have stability issues. A good solution for tag colors based on formula fields would have Softr support Airtable’s new feature that transforms them into dropdowns since Softr already applies colors from dropdowns in a base to tags.
Hey @Ben! I had no idea about that feature - thank you! I set it up in Airtable and looks good, but unfortunately when bringing it into Softr it doesn’t change the colours. My setting is ‘As defined in data source’.
I spoke to the Softr support team and apparently dont support colors from ‘formula fields as single select fields’ yet. Have you got it to work before?
Here is a bit of a workaround that could help.
Create a single select field with all status and colors. Create an airtable automation that looks at your custom coded field (or any changes happening to it) and update the single select field accordingly. In softr change the data source field to the single select.
Hello @jak. I’ve got some good news for you, we edited the custom code and this one should work on beta blocks too. Please try it out and let me know if there is anything else I can help you with.
Hi, I tried to make it work thru a “List with horizontal cards and upvote button”, one of the content fields is a formula field from Airtable formatted from Airtable to give results as single select outputs, in my case the list it’s called “encuesta-inicial-escuelas-por-responder” and the outputs can only be “Sí” or “No”, I modified the code to the following, but I’m not getting any colors…