Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

When search results on SharePoint include InfoPath 2010 forms, the default link is directly to the .XML file. By default, the browser attempts to open in the form in the form filler. The results also include a "View in Browser" link at the bottom, but it's practical hidden and does not stand out.

Is there a way to alter the search results so that "View in Browser" becomes the default link for all Infopath forms?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Search Results are rendered using XSLT. I don't have a specific example for your problem, but it should not be rocket science to figure out how to do what you want.

Here is a link on how to access and customize the search results Xslt:

http://msdn.microsoft.com/en-us/library/ms544191.aspx

There are a lot of other blog posts on this common issue if you Bing it :)

share|improve this answer
add comment

In the XSL editor, find the line that reads <xsl:variable name=”url” select=”url”> and replace it with the following snippet:

<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="contentclass='STS_ListItem_XMLForm'">
      <xsl:value-of select="sitename"/>
      <xsl:text>/_layouts/FormServer.aspx?XmlLocation=</xsl:text>
      <xsl:value-of select="url"/>
      <xsl:text>&amp;DefaultItemOpen=1</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="url"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>

as per http://phillyxaml.org/blog/Lists/Posts/Post.aspx?ID=41

share|improve this answer
add comment

may i know how you are able to get InfoPath forms in search results. we need to configure any extra in Search service? i am not able to get search results when my Form contains the search keyword. please advice what needs to be done. thanks in advance.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.