Today I created a display template within SharePoint 2013 site showing document that are checked out to me. All easy until I created a mix of publishing and team sites.

Within my display template I was using the following line to create a check in button next to my document name:

[code lang=text]
<button id=”tr-checkin” style=”float: right;” type=”button”>Check in</button>
[/code]

SharePoint 2013 - The Path has lost its way for Markdown files within SharePoint search Microsoft SharePoint, SharePoint 2013 lost

The Url in ctx.CurrentItem.Path for my documents in team site would look like this:

http:/ /myspdev/subsite/team/Shared Documents/Doc1.docx

All great!

But then when I added a checked out document to a team site. I found that my url for the document was set to the display form rather than the document url:

http:/ /myspdev/subsite/Shared%20Documents/Forms/DispForm.aspx?ID=1

So I updated my display template  to point the use to the edit form using the link to the display form. At least there is a checkin button there:


&lt!--#_ if (path.indexOf("ID=") !== -1) { #-->
&lta id="tr-checkin" style="float: right;" href="
#= ctx.CurrentItem.Path =#"&gtCheck in&lt/a&gt
&lt!--#
} else { #-- >
&ltbutton id="tr-checkin" style="float: right;" type="button">Check in</button&gt
&lt!--#
} _#--&gt

SharePoint 2013 - The Path has lost its way for Markdown files within SharePoint search Microsoft SharePoint, SharePoint 2013 checkin

So it looks like  there are more differences between publishing libraries and non publishing libraries than expected. I had a look through other crawled properties within the search configuration, but couldn’t find anything that points to the document within my team sites.

Not wanting to be beaten that easily I created some more sub sites and then I found that some of my team sites were returning the right url. So could the issue be related to something else?

In the above screenshot the readme file is a .md file. So it looks like Markdown files are not handled properly within the SharePoint search engine.

By Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

2 thoughts on “SharePoint 2013 – The Path has lost its way for Markdown files within SharePoint search”
  1. My guess is that SharePoint is being “helpful” for file extensions it can’t open in the browser. But in your case, it’s not so helpful.

    M.

    1. Hi Marc,
      Indeed. I’m not sure though why this depends on the file format. So far I’ve seen the issue with Markdown. At least most common office file formats don’t seem to cause any problems.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.