Hi all,

I am trying to get users to add a custom color to a category then use the tag widget to use this color.

However to set the color of the tag I need to use a color identifier. So I tried to add an attribute with a data type of color identifier and it gives me the following error.


Invalid Property Value
'Color Identifier' is defined in an integration or in a Library module and cannot be used as Data Type of an Entity Attribute.


Any ideas on how I can get this to work? Am I just missing an obvious step? Or has anyone tried using custom colors for tags before and have a different solution?

Solution

Hi Adam,

It seems the Colour entity is defined inside a Library Module. It's a new type of module. Static Entities defined inside it can be referenced, but you can't have FK's to them.

But you can style a TAG with the following CSS:

.tag { background-color: red; }

If you want to add a dynamic colour, defined by the user, I would say the easiest way is to create your own "Tag" web block. You can clone OutSystems UI and copy the Tag, changing it accordingly. Or create one from scratch.

To change any other way you would need a CSS selector that included the colour, I think, and this would defeat the idea of the colour being "dynamic".

Cheers.



Solution

Eduardo Jauch wrote:

Hi Adam,

It seems the Colour entity is defined inside a Library Module. It's a new type of module. Static Entities defined inside it can be referenced, but you can't have FK's to them.

But you can style a TAG with the following CSS:

.tag { background-color: red; }

If you want to add a dynamic colour, defined by the user, I would say the easiest way is to create your own "Tag" web block. You can clone OutSystems UI and copy the Tag, changing it accordingly. Or create one from scratch.

To change any other way you would need a CSS selector that included the colour, I think, and this would defeat the idea of the colour being "dynamic".

Cheers.




Thanks for the response. I was hoping that there was something. I have already started creating my own web block to do this and passing the hex color value to it. Will continue with this.


Thanks