Salesforce Community: Using CSS to hide fields on Articles

269 Views Asked by At

In the Article Content, Salesforce displays a few things that make the article heavy and not user-friendly. Only using CSS can you hide fields you don't want displayed. In my case I'm looking to remove the Title, URL Name, Question, and Answer (title only, however, not a huge problem if it stays).

Everything in the orange box is to be removed. "ANSWER" can stay or leave, not a huge deal

2

There are 2 best solutions below

0
On BEST ANSWER

The CSS override I have now that has helped is:

.slds-form.slds-form_stacked .slds-gutters_small:nth-child(-n+4) {
    display: none;
}

.test-id__field-value {
    padding-top: 25px;
    padding-bottom: 50px
}
1
On

And? What have you tried, what are you stuck with?

You could make a custom aura/lwc component to display the article (read record id from page url from what I remember, query it with apex or getRecord) or in the community page builder Settings -> Advanced -> Edit head markup and you'd put your CSS overrides there.

https://help.salesforce.com/s/articleView?id=sf.community_builder_page_head.htm&type=5