2

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?

3 Answers 3

1

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 :)

1

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

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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