Placing the Search Center on a public portal page
Depending on your environment, you might want to place the Search Center portlet on a public page of your HCL Digital Experience and have the search box in the portal theme take users who do a search to that public Search Center.
To do this, you need to create your custom search center page, place a copy of the Search Center on it, and adapt the file search.jsp accordingly. Proceed as follows:
-
Create your custom search center page.
Complete the fields and select options as required. Make sure to specify a Search and Tag Center profile for the page as follows:
-
If you create the page by using the Manage Pages functionality in the site toolbar, proceed as follows:
- From the site toolbar, select Page to edit the new search center page.
- From the General tab, select Edit Page Properties.
- In the Manage Page Properties window, select the Advanced tab.
- Scroll to the Metadata section of the Manage Page Properties window.
-
To specify the Search and Tag Center profile for the custom search center page, add the key resourceaggregation.profile with the value of profiles/profile_search_tag.json to the list of key value pairs.
Note
If you created the custom search center page as a child to the original Search Center page, the Search and Tag Center profile is inherited from the parent page.
-
Click Save.
-
If you create the page by using the Manage Pages administration portlet, proceed as follows:
- Select Edit Page Properties for the page.
- Select Advanced options.
- Select I want to set parameters.
- Add the parameter resourceaggregation.profile with a value of profiles/profile_search_tag.json.
- Click OK > OK.
-
-
Add the Search Center portlet to the custom search center page by completing the following steps:
-
From the custom search center page, select the Create tab in the site toolbar.
-
From the Applications tab, select the Search Center portlet.
-
Select Add to Page ... to add the Search Center portlet to the page.
-
-
To open the Manage Pages portlet, click the Administration menu icon. Then, click Portal User Interface > Manage Pages.
-
Locate your custom Search Center page in the Manage Pages portlet.
-
Give your custom Search Center page a unique name by completing the following steps:
-
Select Edit Page Properties.
-
Specify a value for the Unique name.
-
Click OK.
-
-
Give the portlet window for the Search Center a unique name:
-
Select Edit Page Layout.
-
From the portlet menu, select Set portlet window unique name.
-
Specify a value for the Unique name.
-
Click OK > Done.
-
-
Change to the directory
[PortalServer\_root](../reference/wpsdirstr.md#wp_root)/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/themes/html/dynamicSpots/modules/search -
Edit the file search.jsp.
-
Locate the following code snippet that points to the default Search Center page:
wp.navigationModel['ibm.portal.Search Center'].urlGeneration.setPortlet('ibm.portal.Search Center Portlet Window') -
Change the values for
navigation nodeandcontrol holding:- Change the value for
navigation nodeto the unique name of your custom Search Center page. - Change the value for
control holdingto the unique name that you gave the copy of your Search Center portlet.
After your updates, the code snippet might look like the following:
wp.navigationModel['ibm.portal.your_public_search_center_page_unique_name'].urlGeneration.setPortlet('ibm.portal.your_public_search_center_portlet_window_unique_name') - Change the value for
-
Restart your portal server.
When your portal users do a search by using the search box in the theme, they are now directed to the Search Center on your public portal page.