1

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?

1

This worked for me -

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.