html
<template for:each={linksShortlist} for:item="link">
<li key={link.label} class="nhsuk-grid-column-one-half">
<a href={link.href}>
<span>{link.label} </span>
<c-nhs-icon icon-name="chevron-right" no-fill class="launchpad-item"></c-nhs-icon>
</a>
</li>
</template>
js
connectedCallback() {
console.log(Id);
//const existingLinks = getUserLaunchpadItems();
const newShortcuts = [
{ label: 'Forms', href: '/forms', target: '_blank' },
{ label: 'Requests', href: '/requests', target: '_blank' },
{ label: 'Frame', href: '/frame', target: '_blank' },
{ label: 'Payments', href: 'ClientInviteForm__c', target: '_blank' },
{ label: 'Supplier', href: '/supplier', target: '_blank' },
{ label: 'Invoice Hold Form', href: '/invoice-hold-form', target: '_blank' },
];
// this.linksShortlist = [...existingLinks, ...newShortcuts ];
this.linksShortlist = newShortcuts;
//console.log('value from getUserLaunchpadItems' ,existingLinks);
console.log('value of shortlinks' ,newShortcuts );
console.log('combined value',this.linksShortlist);
this.navigateToComponent();
}
navigateToComponent(href)
{
//console.log('inside form navigation',href);
//console.log('href',href);
const pageReference = {
type: 'comm__namedPage',
attributes: {
name: href,
},
};
this[NavigationMixin.Navigate](pageReference);
console.log('pageRef',pageReference);
}
Need navigation to community page when click on the link.