3

I am creating my own custom Organization__c record page for a community.

I am using lightning:recordViewForm and lightning:outputField for all the fields that I want to display, but, I have a few fields that I want to display in a different way - not as standard lightning:outputField:

enter image description here

As you can see from the image - in the red square, the text is built from 2 fields - OrganizationNumber__c and Name, and I want to show these 2 fields like that.

So I want bigger text size, no label and text color, and I cannot find a way to do that with lightning:outputField.

Questions:

  1. Is there a way to achieve that - with lightning:outputField?
  2. Is there a way to achieve that without the use of lightning:outputField?
2

Use <lightning:outputField fieldName="name" variant="label-hidden"/> to remove label.

For bold / italics / height, use CSS using font-weight, font-style properties.

0
  1. Not easily without messing with style in order to replicate SLDS components as @Ayem suggested. I would not go down this path.

  2. I recommend that you use a combination of lightning:recordViewForm and force:recordData (that is the Lightning Data Service aka LDS). Using both wouldn't cause a significant performance degradation since lightning:recordViewForm relies on LDS so they both share the same cache. You could use the data loaded by LDS into an attribute and inject it in any component.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.