Add custom text color to field
Collapse
X
-
Thanks. Also for anybody struggling with this make sure to add "view": "views/fields/enum-styled" on the custom field. -
Hi
from enum-styled detail tpl
Code:<span class="text-{{style}}">{{translateOption value scope=scope field=name}}</span>
Code:"style": { "Completed": "success bg-danger" }
Leave a comment:
-
Thanks for the above e.i, But to be able to change the background will be definitely a better approach, hopefully somebody can give us a hint!Leave a comment:
-
My Example \htdocs\custom\Espo\Custom\Resources\metadata\enti tyDefs\Account.json
It is works.
Since the font is not thick in the form fields, The color of the font has little effect. It is better to change the background of the form fields than to change the color of the font.
Unfortunately, I do not know how to do that.
{
"fields": {
"name": {
"type": "varchar",
"required": true,
"trim": true,
"tooltipText": "hier steht der Firmenname",
"audited": false,
"tooltip": true
},
"status": {
"type": "enum",
"required": false,
"options": [
"aktiv",
"Inaktiv",
"rechtsstreit"
],
"view": "views/fields/enum-styled",
"style": {
"aktiv": "success",
"rechtsstreit": "warning",
"Inaktiv": "danger",
"[option]": "[style]"
},
"isSorted": false,
"audited": false,
"tooltip": false,
"isCustom": true
}
}
}Leave a comment:
-
Hey peterberlin can you add a sample of your working code .. I can't get this to work as Tanya suggested... ThanksLeave a comment:
-
Hi Tanya,
It works very well. How to define the color of the background? "bg-danger" is not enough.
PeterLeave a comment:
-
Hi
my text
"style": {
"Completed": "success",
"Canceled":"muted",
"[option]":"[style]"
},
your text
"style": "success"
Style has to be an ObjectLeave a comment:
-
tanya I had tried all the above, but still not getting any result - Do I need to add any code at the css file? Here is what I did:
1- Add a custom field on module -> Lead
2- Open Lead.json from the custom path -> /custom/Espo/Custom/Resources/metadata/entityDefs
3- {
"fields": {
"test": {
"type": "varchar",
"required": false,
"style": "success", <-------- This is the addes style
"trim": true,
"audited": false,
"tooltip": false,
"isCustom": true
}
}
}
4- Clear local Cache
5- Administrator -> Clear Cache
6- Administrator -> Rebuild
Still not changes on Test field
Am I missing something?
Thanking in advanceLeave a comment:
-
You have to change entityDefs file, not language ( path - custom/Espo/Custom/Resources/metadata/entityDefs/mypage.json)
Hope this example helps you (I got it from application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json)
{"fileds":{
"status": { ----------------your fields name
"type": "enum",
"options": ["Not Started", "Started", "Completed", "Canceled", "Deferred"], -----------------your option list
"view": "views/fields/enum-styled",
"style": {
"Completed": "success",
"Canceled":"muted",
"[option]":"[style]"
},
"default": "Not Started", --------------your default value
"audited": true
}, .............
All styles are from bootstrap (["muted", "primary", "success", "info", "warning", "danger"])
Leave a comment:
-
Add custom text color to field
Hi,
I'm trying espocrm few days.
like this a lot.
I would just like to be able to change the color of the words in the fields, for example, for the priority.
I would put red orange and green for the three states.
but I do not understand how to make this change in json.
I tried to change the "mypage.json" file ( picture in attached) that is generated for the language here:
/custom/Espo/Custom/Resources/i18n/it_IT
someone can kindly help me to conclude this change correctly?
Thanks a lot to everyone!1 PhotoTags: None
Leave a comment: