掲示板
Using liferay-ui:search-toggle - Advanced Search Only
12年前 に Kamesh Sampath によって更新されました。
Using liferay-ui:search-toggle - Advanced Search Only
Regular Member 投稿: 158 参加年月日: 10/05/27 最新の投稿
Hello,
Today I met with a interesting scenario, I was using <liferay-ui:search-toggle> tag, and my requirement was to to show only advanced search and no basic search. but by default <liferay-ui:search-toggle> will show basic search unless and until user clicks the advanced search atleast once. I tried all possible ways and finally found the solution, this what i did to make my <liferay-ui:search-toggle> show only "Advanced Search" without "Basic" search toggle link
Today I met with a interesting scenario, I was using <liferay-ui:search-toggle> tag, and my requirement was to to show only advanced search and no basic search. but by default <liferay-ui:search-toggle> will show basic search unless and until user clicks the advanced search atleast once. I tried all possible ways and finally found the solution, this what i did to make my <liferay-ui:search-toggle> show only "Advanced Search" without "Basic" search toggle link
- We need to override the isAdvancedSearch method of the XDisplayTerms class to always return true, where "X" your class prefix e.g.ArticleDisplayTerms which extends form com.liferay.portal.kernel.dao.search.DisplayTerms
- Update your *_search.jsp which has the <liferay-ui:search-toggle> with the following piece of code
<style type="text/css"> .toggle-link { display: none; } </style> this style overriding will prevent the "<<basic" search link form being displayed, the next piece of code snippet will make "advanced" displayed by default, we are a kind triggering search click .... string key="<replace with the id of your <liferay-ui:search-toggle> tag" ; sessionclicks.put(request, key,"advanced"); ..... <></basic">
<br>That is it, once we have done with this our <liferay-ui:search-toggle> will always display only "Advanced" search and "Basic" search will be hidden<br><br>If someone else has done the same in a different way please do post the same. <br><br>I hope this post will help our community who are looking for a similar solution.<br><br>Thanks.<br>Regards,<br>Kamesh
12年前 に Mani kandan によって更新されました。
RE: Using liferay-ui:search-toggle - Advanced Search Only
Expert 投稿: 492 参加年月日: 10/09/15 最新の投稿
Good work thanks
12年前 に Nagendra Kumar Busam によって更新されました。
RE: Using liferay-ui:search-toggle - Advanced Search Only
Liferay Master 投稿: 678 参加年月日: 09/07/07 最新の投稿
Thank you very much for sharing Kamesh