1

I want to navigate from lwc component firstComponent to a community page enerie test.

FirstComponent

import { NavigationMixin } from 'lightning/navigation';

export default class FicheNutrition1 extends NavigationMixin(LightningElement) {
...
handleLevier1Click() {
        console.log('this is levier 1');
        this[NavigationMixin.Navigate]({
            type: 'comm__namedPage',
            attributes: {
                pageName: 'energie_test__c'
            },
        });
        console.log("##############");
    }
...
}

API name of the page: energie_test__c . it contains a custom lightning component. I tried navigating to the component first but it didn't work either.

1 Answer 1

1

For comm__namedPage use the name attribute

this[NavigationMixin.Navigate]({
    type: 'comm__namedPage',
    attributes: {
        name: 'energie_test__c'
    },
});

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .