Posted in Salesforce

Salesforce Lightning Communities : Working Navigation with LWC Component

Lightning component uses forceCommunity:navigationMenuBase extension to create customized navigation for the community templates. It has v.menuItems variable that holds the menu items created in the navigation. But the equivalent extension is not available for the LWC component yet.

Still, if we decide to go with LWC, here is the way:

READ MORE
Posted in Salesforce

Salesforce Lightning : A better way to handle component.find return value

I have always seen Salesforce Aura Component developers using multiple checks before fetching data from component.find method. It is because, it does return three types of results:

  1. undefined – when there are no items found on the DOM
  2. Single component – when there are only one item found in the DOM
  3. Array of components – when there are more than an item found in the DOM
Continue reading “Salesforce Lightning : A better way to handle component.find return value”