In the template below, Is there a way to change the text color of 'Product on Allocation' if 'On_Allocation is true? Can you embed CSS or HTML?

-
1,454 Points
Posted 4 years ago
Moshe Karmel, Champion
-
8,646 Points
Try something like this:
{{#On_Allocation__c}}<font style="background-color:red;color:white;font-weight:bold;padding:3px;position: relative;"> -- PRODUCT ON ALLOCATION </font>{{#On_Allocation__c}}
-
1,454 Points
Hi Moshe,
Thank you very much for the reply. I tried the following, simplify it a bit, but there was no change to the test displayed? Any thoughts?
{{Name}}{{Description}} <font style="background-color:red; color:white; font-weight:bold; padding:3px; position: relative;"> -- PRODUCT ON ALLOCATION </font> {{Product_Category__c}}
Thank you very much for the reply. I tried the following, simplify it a bit, but there was no change to the test displayed? Any thoughts?
{{Name}}{{Description}} <font style="background-color:red; color:white; font-weight:bold; padding:3px; position: relative;"> -- PRODUCT ON ALLOCATION </font> {{Product_Category__c}}
Matt Sones, Champion
-
31,702 Points
Irvin Waldman, Champion
-
9,016 Points
You probably don't won't to use the tag as it is not supported in HTML 5. Use a instead. I will leave it to our fellow web brethren to correct me.
{{Name}}{{Description}} -- PRODUCT ON ALLOCATION {{Product_Category__c}}
Oh, yes, enable "Allow Html" per Jim.
{{Name}}{{Description}} -- PRODUCT ON ALLOCATION {{Product_Category__c}}
Oh, yes, enable "Allow Html" per Jim.
-
1,454 Points
I do not think I can "Allow HTML" as this is just the Display Template/Search Template fields for the Search properties on a lookup field. This is not a Template component field.
Rob Hatch, Official Rep
-
44,168 Points
You can certainly embedd html in a normal template, but you are using the templates provided to show reference fields. HTML is not interpreted here. This looks like a perfect scenario for writing a custom renderer. JavaScript to the rescue.
(Edited)
-
496 Points
Hi, how could I put a snippet and invoke it on loan for this case?
Matt Sones, Champion
-
31,702 Points
In the Basic menu for the field choose 'snippet' for the rendering property, and enter the name of your snippet in the box that appears.
There are lots of examples of custom field renderers here on the community and in the docs.
There are lots of examples of custom field renderers here on the community and in the docs.
-
496 Points
Hi Matt, there's no way to invoke snippet inside template field, right?

