0

In a HotTowel application, I'm having trouble linking to files for users to click on and view directly.

On one of my views, I have a list of biographies. So, an image, title, link to resume, etc.

I have mapped the image to link to the resume and the title to link to the resume using a link with a target of "_blank" and the url databound to the correct path.

The paths are correct for the image and the reference to the resume PDF, but if I click on them, they just return to the home page.

If I right-click and select "open in new tab", the file opens fine. The image shows up as well, so I have no doubt the paths are right.

It appears that HotTowel (or a component -- SammyJS?) may be intercepting clicks on links and doing something differently. Any idea where that's located or how to turn it off?

SeanKilleen
  • 8,809
  • 17
  • 80
  • 133
  • As an FYI, I think the solution may be related to the one found here (just not sure how to apply that to the HotTowel setup with all its components in the mix): http://stackoverflow.com/questions/9144734/sammy-js-404-on-root-path/13495029#13495029 – SeanKilleen Aug 04 '13 at 11:10

1 Answers1

0

You can use a guardRoute function that comes with Durandal to protect a particular route that you don't want Sammy.js to route for you - How to handle / ignore a bad route with durandal?

As noted in the other question, which is hard to find due to the title, you can guardRoute such as this in your shell.js -

router.guardRoute = function(routeInfo, params, instance){
    if (params.fragment === ''){
        return routeInfo.router.routes[0].hash;
    }
    return true;
};
Community
  • 1
  • 1
PW Kad
  • 14,953
  • 7
  • 49
  • 82