Sco*_*ion 7 search liferay liferay-6
我使用liferay搜索容器来显示信息列表,但是在那个liferay搜索容器中默认显示记录的数量,如"显示2个结果".但在我的情况下,我不想显示这个.我该如何删除?还附上了搜索容器的图像.

欢迎提出建议.
您可以使用Felix Christy建议的Javascript执行此操作:
以下是快速步骤:
转到javascript部分添加以下内容,其合并UI javascript框架与liferay捆绑在一起:
AUI().ready(
function(customA) {
customA.all('.taglib-page-iterator').hide(); // this would hide **all** the elements which have the class "taglib-page-iterator"
}
);
Run Code Online (Sandbox Code Playgroud)上面的javascript代码可以包含在自定义portlet的JSP本身中(注意我已更改的方法和选择器),如:
<aui:script>
AUI().ready(
function(customA) {
customA.one('#my-portletID .taglib-page-iterator').hide(); // this would hide only **one** element (the first it finds) which has the css class "taglib-page-iterator" under an element with id="my-portletID".
}
);
</aui:script>
Run Code Online (Sandbox Code Playgroud)通过Hook的另一种可能解决方案
您可以创建一个钩子,如Sandeep Nair所提到的,以隐藏结果文本,但是您可以设置一个条件来检查隐藏,只有当您要隐藏此页面的URL或者可能有条件检查您要隐藏此结果文本的特定portlet.
因此它可以正常用于其他页面和portlet,但会隐藏您的页面和您定义的某些portlet.这是一个想法,还没有尝试过,但我认为它会起作用.您可以使用themeDisplayJSP页面上可用的对象来检索portlet-id.
希望这可以帮助.
感谢Felix Christy通过Javascript建议解决方案.
我想把我的评论转换成答案,以便更好地了解这个精彩社区的其他成员.