Add More Customizations
This section describes several advanced customizations, such as creating custom record components and using Apex and SOQL for search.
-
Create Custom Record Components
The Build Your Own (LWR) template doesn’t include record components, but you can use the User Interface API to construct your own custom components.
-
Create a theme layout search component that sends the user to a search results page.
-
Use Expressions to Add Dynamic Data to LWR Sites
With expressions, you can make calculations and access property values and other data from Salesforce or content from Salesforce CMS to pass into a component’s attributes. Use expressions for dynamic output or for passing values into components by assigning them to attributes.
-
Create a Logout Link Component
To log out your users, you can create a custom logout link component.
-
Integrate Third-Party Libraries Using the Privileged Script Tag
Some components within an LWR site encapsulate their elements in shadow DOM, which prevents global interaction with those components. As a result, third-party JavaScript libraries such as Google Analytics and Google Tag Manager can have trouble querying the DOM globally on an LWR site. When programmatic access to an element within the DOM is needed, you can write scripts within an
<x-oasis-script>privileged script tag. Loading third-party libraries using this privileged script tag lets those libraries bypass any shadow DOM boundaries.