Foren

Searching child sites from the parent site

thumbnail
William Gosse, geändert vor 7 Jahren.

Searching child sites from the parent site

Liferay Master Beiträge: 533 Beitrittsdatum: 04.07.10 Neueste Beiträge
Using Liferay 6.2. Is there a way to use the search portlet to search both a site and its child sites as well?
thumbnail
William Gosse, geändert vor 7 Jahren.

RE: Searching child sites from the parent site (Antwort)

Liferay Master Beiträge: 533 Beitrittsdatum: 04.07.10 Neueste Beiträge
I figured this out. In my customization of the search portlet I needed to set the groupId parameter to 0

<form action="<%= HtmlUtil.escapeAttribute(portletURL.toString()) %>" method="get" name="<%= randomNamespace %><%= namespace %>fm" onSubmit="<%= randomNamespace %><%= namespace %>search(); return false;">
<liferay-portlet:renderURLParams varImpl="portletURL" />

<!--
<aui:fieldset>
<aui:input placeholder="&#128269; Search" inlineField="<%= true %>" label="" name='<%= namespace + "keywords" %>' size="30" title="search" type="text" useNamespace="<%= false %>" value="<%= HtmlUtil.escapeAttribute(keywords) %>" />
<aui:input inlineField="<%= true %>" label="" name="search" src='<%= themeDisplay.getPathThemeImages() + "/common/search.png" %>' title="search" type="image" />
</aui:fieldset>
-->

<span id="tfnewsearch">
<input placeholder="Search..." type="text" class="tftextinput" name='<%= namespace + "keywords" %>' size="25" maxlength="120" value="<%= HtmlUtil.escapeAttribute(keywords) %>"><input type="submit" value="&#128269;" class="tfbutton">
<input type="hidden" name='<%= namespace + "groupId" %>' value="0">
</span>