[SalesForce] LWC: How to call a community page on button click in LWC

How to call different community page from LWC page on button click that exists on a community page without passing the URL?

navigateToWebPage() {
        // Navigate to a URL
        this[NavigationMixin.Navigate]({
            type: 'standard__webPage',
            attributes: {
                url: 'http://salesforce.com'
            }
        },
        {
            // Replaces the current page in your browser history
            // with the URL
            true
        });

Is there any way by which I just pass the community page name and it calls that?

Best Answer

This worked for me -

this[NavigationMixin.Navigate]({
            type: 'standard__namedPage',
            attributes: {
                pageName: 'becomepartner',
            },
        });
Related Topic