Using "surround with" for attribute values in Razor?

I'm working on moving static HTML templates to Razor views, and have a lot of link, script and image tags like this:

<link href="assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

I'm trying to add a surround with template to allow me to highlight the href value (or "src" for script tags) and wrap them in @(Url.Content("~/$SELECTION$")).  I've added a surround template, but it doesn't seem to show up in the surround with menu.  I know this menu has some context awareness, and was wondering if there's anything special I need to do to get this to work?



Comment actions Permalink

You'd have to move the template into the quicklist in the templates explorer for it to show up when using the surround with menu. You can just drag and drop it when in the templates explorer, otherwise, it will just be available via the "more..." menu item and dialog box.

Comment actions Permalink

Thanks Matt.  I actually tried that, but it didn't seem to work, though I found that clicking more a few times and selecting it from there got it to show up on the list, so it's working now.  Wasn't aware that the quicklist was based on recently used items, or that a template had to be used a few times before it would show up on the list.


Please sign in to leave a comment.