Overriding DefaultLinkHandler? making router play nice with other

Hi all, maybe someone has a tip for me.

I have an Aurelia enhanced site that is using Django CMS to serve pages. I am also using the Aurelia Router, it’s not a single page app, but some components are reacting to url changes. Links that require a page change are marked with the router-ignore attribute.

The problem is that Aurelia is hijacking the click events of Django CMS frontend controls. The Django CMS controls are wrapped in standard elements. I cant easily mark those elements with the router-ignore attribute because they are generated outside the scope of my App code.

Might it be possible to configure the Aurelia Router to generally ignore all standard a.href element and instead use some custom element? I am thinking I might be able to override the DefaultLinkHandler and inject that into the Router in the main.ts. Not sure how to achieve this and haven’t found any other related issues.

Any tips would be greatly appreciated. Thanks in advance!

1 Like

Have you seen this https://github.com/aurelia/history-browser/pull/32#issuecomment-409470589

If not, maybe give it a shot. I can also help if you are not sure how to apply that to your application