function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris Wilkinson 26Chris Wilkinson 26 

How to browse to comm__namedPage pages using the Navigation Mixin

Hello,

I've read and re-read the documentation around using the Navigation Mixin to browse to Community/Experience named pages and I can't get it to work.

I have dom element with a click handler that looks like this:
handleMenuItemClick() {
    console.log("Menu Item clicked: " + this.label + ", pageApiName:" + this.pageApiName);
    var pageRef = {
        type: 'comm__namedPage',
        attributes: {
            name: this.pageApiName
        },
    };
    
    console.log("pageRef: " +     JSON.stringify(pageRef));

    this[NavigationMixin.Navigate](pageRef);
}

The output of printing my PageReference object to the browser console is this:
{"type":"comm__namedPage","attributes":{"name":"Contact_Support"}}

I'm using the API name to identify the Contact Support page.  The documentation says this is supported:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_page_definitions.htm

However, it doesn't work and I'm stumped.  Are there any examples how to use the Navigation Mixin to browse to the Contact Support, My Account or Account Management pages?

Thank you,

Chris
SwethaSwetha (Salesforce Developers) 
HI Chris,
Recommend reviewing https://www.sfdcpoint.com/salesforce/navigation-service-in-lwc/
Also, https://salesforce.stackexchange.com/questions/254496/lwc-navigation-thisf-navigationmixin-navigate-is-not-a-function
ravi soniravi soni
hi Chris,
Recommend reviewing 
https://salesforce.stackexchange.com/questions/273250/lwc-navigation-issue-in-communities

Thank You
Yash Standard UserYash Standard User
this[NavigationMixin.Navigate]({
type: 'comm__namedPage',
attributes: {
pageName: 'new-application'
}
});

where 'new-application' is the page name you want to navigate to. 
Please mark as Best answer if it works for you as it works for me.