Loading

Standard layout for Record List component does not allow custom sort function

Publiceringsdatum: Oct 13, 2022
Beskrivning
At this time the Record List standard component in Experience Sites does not support sorting based on the fields present in the list view. The only method to allow sorting is by using the full layout instead. The problem this poses is that it exposes the Record List Header which allows the User to switch between list views as well as access the list view buttons and filter options. This is not always desirable depending on your business need. 
Lösning

While a standard solution to allow sorting on the standard layout is not available, you can use custom CSS as a workaround to hide the Record List Header. Please note that this solution is not perfect. It does affect the community on a global level, so any Record List components added to the site would be affected by the CSS override. 

To hide the header using CSS do the following:
 
  1. Access Experience Builder from Setup.
In Salesforce Classic: Setup | Customize | Digital Experiences | All Sites | Builder
In Lightning Experience: Setup | Digital Experiences | All Sites | Builder
 
  1. Click the Theme menu.
  2. Click on the down arrow drop-down and click Edit CSS under 'Manage Branding Sets.'
  3. Once the CSS editor opens enter the following markup: 
.forceCommunityRecordListDesktop .slds-page-header {display: none;}
 
  1. Click Save.
  2. Click Publish.

Once the publish is complete you can access any page that contains a Record List component and the header should no longer be present. 


A few considerations regarding this:
 
  • Custom CSS is out of scope for Salesforce support so we cannot advise you on what mark up to use within your site. 
  • This is provided as a workaround and not a permanent solution. If you wish to have a component that does not display the header but offers the ability to sort based on the list view field then a custom component would be needed. 

If you would like to vote on the Idea related to this workaround please see Community Templates: Record List View Component Sorting.
Knowledge-artikelnummer

000384319

 
Laddar
Salesforce Help | Article