SharePoint 2010 搜索结果文件图标更改 [英] SharePoint 2010 Search Result file icon change
问题描述
我正在尝试将 aspx 文件图标从默认图标更改为自定义图标.我为此部分编辑了 results.aspx 页面获取的属性"的 xsl.我想确保为具有LegalDocument"内容类型的项目显示 LegalDoc16.gif 图标.如果我不需要正确配置语法,请告诉我.我可以进行类似 ContentType:"legaldocument" 的搜索,并获得所有文档.所以我知道正在提取 contenttype 元数据属性.请建议.
<xsl:when test="string(ContentType)='LegalDocument'"><img align="absmiddle" src="_layouts/images/LegalDoc16.gif" border="0" alt="{imageurl/@imageurldescription}"/></xsl:when><xsl:否则><img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}"/></xsl:否则></xsl:选择>
一切都很好.在运行powershell之前我要做的就是转到文档库并添加一个基于Linked to Document的文件(并删除测试上传文件).之后就成功了.
I am trying to change the aspx file icon from default icon to customized icon. I edited the xsl of the results.aspx page "fetched properties" for this section. I wanted to make sure that LegalDoc16.gif icons are displayed for the items who has "LegalDocument" content type. Please let me know if I dont have to syntaxed properly configured. I can do a search like ContentType:"legaldocument" and I get all the documents. so I know contenttype metadata property is being pulled. Please suggest.
<div class="srch-Icon" id="{concat($currentId,'_Icon')}">
<xsl:choose>
<xsl:when test="string(ContentType)='LegalDocument'">
<img align="absmiddle" src="_layouts/images/LegalDoc16.gif" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:when>
<xsl:otherwise>
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</xsl:otherwise>
</xsl:choose>
</div>
Everthing was fine. All I had to do before running the powershell, go to the document library and add a file based on Linked to Document (and delete the test upload file). After that it worked.
这篇关于SharePoint 2010 搜索结果文件图标更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!