I was having issue with NavigationMixin(LightningElement) while working in Salesforce Experience cloud (sites), I was unable to navigate from one site page to another using code. Working snippet of navigating from one site page to other (community and site page example)
Initial Code looks like this :
1let authenticatedUser = await this.callAuthenticationOrAnyother();if (!authenticatedUser) {
2this[NavigationMixin.Navigate]({
3type: "comm__namedPage",
4attributes: {
5name: "Sample1__c"
6}
7});
8}
What are the things I was missing and how I fixed -
- Make sure the api name of the site page is exactly same (it’s a case sensitive and make sure you are appending __c in the end of the name just like mentioned above)
