Forums de discussion

Search portlet configuration

Dan Cotton, modifié il y a 10 années.

Search portlet configuration

New Member Publications: 11 Date d'inscription: 22/11/07 Publications récentes
Is it possible to change the default "scope" within the search portlet in EE 6.2?

Currently there are two options in the drop down list for the scope "Everything" and "This Site".

The current default selection in the drop down list is "Everything" we would like to change that to be "This Site".

Is this possible and if so how is it accomplished?

Thanks
thumbnail
Antoine Comble, modifié il y a 10 années.

RE: Search portlet configuration

Regular Member Publications: 232 Date d'inscription: 07/09/12 Publications récentes
Hi Dan,

You should create a hook and overriding search.jsp for search portlet : ROOT/html/portlet/search/search.jsp.
Then, change the code by your own :

<aui:select inlinefield="<%= true %>" label="" name="groupId">
			<aui:option label="everything" selected="<%= groupId == 0 %>" value="0" />
			<aui:option label="<%= &quot;this-&quot; + (group.isOrganization() ? &quot;organization&quot; : &quot;site&quot;) %>" selected="<%= groupId != 0 %>" value="<%= group.getGroupId() %>" />
		</aui:select>


Regards,

Antoine