Facts #27 || CSS Tricks and scenarios related to Community Portal
When we are developing community portal by using OOTB functionalities. In some scenarios we need to hide the fields, buttons, list views from desktop and mobile.
Will discuss some scenarios and CSS what can be used to make that scenario possible.
To find the CSS class you need to search CSS class by inspecting the community page.
----------------------------------------------------------------------------------------------------------------------------
Scenario 1: If you are using case object page layout on community portal and business asked to remove the status field from the page layout [view and edit mode] but status field is required field and we can't hide this field from profiles and page layouts.
Solution:
Create one section in page layout and add status field to that section.
To hide that section which contains status use below CSS to hide that section from page layout in Community portal
// nth-child(n) -- nth section of the page layout you can replace the n value based on the requriment.
.test-id__record-layout-container .test-id__section:nth-child(1) {
display:none;
}
.forcePageBlock .slds-section:nth-child(1) {
display: none;
}
-----------------------------------------------------------------------------------------------
Scenario 2: On lightning record pages we can hide Mark status as complete button related to case path from Edit page [Builder] but from community portal we need to add CSS to hide that button from UI.
Solution:
.slds-path .slds-path__mark-complete{
display: none;
}
----------------------------------------------------------------------------------------------------------------------------
Scenario 3: If we are using Record List component on community portal and we need to show only one list view on UI. To remove other lists like Recently Viewed Accounts, Open Accounts ..etc.
Select the list view you need to show on the portal in record list component and use this CSS.
Solution:
.forceVirtualAutocompleteMenuList {
display: NONE;
}
.slds-page-header__name-switcher {
display: none;
}
----------------------------------------------------------------------------------------------------------------------------
Scenario 4: Consider this scenario you need to give edit access to record from detail page not from list view page. To hide that pencil icon [edit button] from portal use this CSS.
Soultion:
.forceVirtualActionMarker.forceVirtualAction{
display: NONE;
}
Comments
Post a Comment