我正在使用 liferay 搜索容器来显示信息列表,但在该 liferay 搜索容器中默认显示记录数,如 “显示 2 个结果” .但就我而言,我不想显示这个。我怎样才能删除这个?还附上了搜索容器的图像。
欢迎提出建议。
最佳答案
您可以按照 Felix Christy 的建议使用 Javascript 来执行此操作。 :
以下是快速步骤:
不想显示此文本)
AUI().ready(
function(customA) {
customA.all('.taglib-page-iterator').hide(); // this would hide **all** the elements which have the class "taglib-page-iterator"
}
);
<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>
通过 Hook 的另一种可能的解决方案:
您可以创建 Sandeep Nair 中提到的 Hook 隐藏结果文本,但您可以设置一个条件来检查仅当页面的 URL 是您想要隐藏它的页面的 URL 时,或者可以有条件来检查您想要隐藏这个结果文本的特定 portlet .
所以它对其他页面和 portlet 可以正常工作,但会为您的页面和您定义的某些 portlet 隐藏。这是一个想法,还没有尝试过,但我认为它会奏效。您可以使用
themeDisplay
在 JSP 页面上可用于检索 portlet-id 的对象。希望这可以帮助。
感谢 Felix Christy用于通过 Javascript 提出解决方案。
我想将我的评论转换为答案,以便更好地了解这个精彩社区的其他成员。
关于search - 如何隐藏在 liferay 搜索容器中显示结果文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10909441/