0

I'm working with DSpace 4.2 xmlui Mirage theme. I want to hide the Communities and Collections from the search results page.

enter image description here

By inspecting the DRI document of the page I found that the Communities and Collections results are added as:

<list id="aspect.discovery.SimpleSearch.list.comm-coll-result-list" n="comm-coll-result-list">

So I tried over-riding the template in the xsl file of the theme.

<xsl:template match="dri:list[@id='aspect.discovery.SimpleSearch.list.comm-coll-result-list']">
<!-- Over ride / remove the recent submissions box-->
</xsl:template>

But no change is reflected in the page. Am I doing something wrong here? I was able to hide the default search box in a similar manner by over-riding the template generating it's corresponding div.I noticed that the list item I want to hide is contained within another div. Is is not possible to over-ride a DRI element unless its tag is div?

4

2 回答 2

0

集合和社区列表结果由以下 XSLT 显示:https ://github.com/DSpace/DSpace/blob/master/dspace-xmlui/src/main/webapp/themes/dri2xhtml/structural.xsl#L3616-L3635

要通过 XSLT 更改显示,请尝试构建您自己的模板代码。

<xsl:template name="collectionSummaryList">
    <xsl:param name="handle"/>
    <xsl:param name="externalMetadataUrl"/>

    <xsl:variable name="metsDoc" select="document($externalMetadataUrl)"/>

    ...
</xsl:template>

如果您从显示中完全抑制这些结果,则可能会使您的分页计数不可靠。从 SOLR 搜索结果中抑制社区/集合结果可能更有意义。

于 2015-02-17T15:58:32.873 回答
0

您还可以在 [dspace]/config/spring/api/discovery.xml 中添加默认过滤器查询

默认过滤器查询适用于所有搜索操作和侧边栏点击。默认过滤器查询的一种有用应用是确保所有返回的结果都是项目。因此,作为搜索操作结果返回的子社区和集合被过滤掉

此处的相关行,请注意默认情况下禁用此功能。取消注释以使这项工作。

<property name="defaultFilterQueries">
<list>
    <value>search.resourcetype:2</value>
</list>

希望这有帮助。

更新

复制:

<property name="defaultFilterQueries">
    <list>
      <value>search.resourcetype:2</value>
    </list>
<property>

<bean id="homepageConfiguration" class="org.dspace.discovery.configuration.DiscoveryConfiguration" scope="prototype">因为它覆盖了本评论中所述的 defaultConfiguration 。

于 2015-02-18T02:43:51.957 回答