Custom Display Form and its problem with Search result
I came into situation exactly like this http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/5461e442-d539-4bc6-b9e8-30db20a62abe/ , where search result still pointing to original display form even it’s been set as not default. Then I followed the suggestion there to input custom display form relative path in Content Type Setting as seen below:
First, It worked, where it actually still pointing the original display form but when it clicked, it redirected to custom display form that’s been set.
But then I tried it to another library, it didn’t work , didn’t know Why.
Another suggestion is to delete original form to leave only one display form then do full crawl. But I don’t want to do that, it’s too risky.
At the end, I came to decision to edit Search Result XSL. Here is my XSL Code :
<xsl:variable name="newurl" select="concat(substring-before(url,'/Forms/'),'/Forms/DispForm.aspx?ID=',substring-after(url, 'ID='))" />