Fórum

Search Portlet default be set to “This site only”

thumbnail
Sai Mohan Gadamsetty, modificado 9 Anos atrás.

Search Portlet default be set to “This site only”

Junior Member Postagens: 92 Data de Entrada: 06/02/13 Postagens Recentes
Hi Guys,

Can any one know how to set search default value to “This site only”. By default Liferay gives results to entire portal scope but I want this to only Site/Group scope.

Will it solve writing hook or any configurations do we have to do to change search portlet default value. Please advise any one how to go forward.

Thanks,

Sai Mohan
thumbnail
Pankaj Kathiriya, modificado 9 Anos atrás.

RE: Search Portlet default be set to “This site only”

Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
There isnt any configuration available, you can achieve this writing hook overriding search.jsp to select This site only option by default.
thumbnail
Sai Mohan Gadamsetty, modificado 9 Anos atrás.

RE: Search Portlet default be set to “This site only”

Junior Member Postagens: 92 Data de Entrada: 06/02/13 Postagens Recentes
Thanks very much Pankaj for your quick reply.

Thanks,

Sai Mohan
thumbnail
Daniel Tyger, modificado 7 Anos atrás.

RE: Search Portlet default be set to “This site only”

Regular Member Postagens: 105 Data de Entrada: 06/02/13 Postagens Recentes
Sai Mohan Gadamsetty:
Hi Guys,
Can any one know how to set search default value to “This site only”. By default Liferay gives results to entire portal scope but I want this to only Site/Group scope.


I had a need for this same thing but wanted to be able to apply it site > site or at a specific page... This Javascript could be added to the page or site level and achieve the same thing:

jQuery(document).ready(function($){
  $('select').find('option[value=6506604]').attr('selected','selected');
});


Where "6506604" is the value (groupId in Liferay) of the site you want the search to default to "This Site..."