Content search results
The content service results-service page is used in the search field column. While this service page is typically a standard feature in Swift, sometimes it needs customization. In such cases, it is helpful to know how it is setup and how to configure it for better functionality.
Here is an example of a solution, where the search function only shows content pages and not products:
Manual setup
This guide will go through the manual setup process for a content search service page.
First you must create the service page, here is how to do that:
- Go to Content -> Swift tools -> Services
- Right-click Services and select "New page"
- Select Service page as the item type
- Provide the page with a title, e.g. "content search results"
- Go to the Publication section and check "Hidden in menu"
- Go to the Layout section and select "Swift: Swift_PageClean.csthml" as the template
- Click Save and close
The page is now ready for you to add the content search function:
- Add a new row to the service page
- Click on the row and add an App paragraph
- Provide the paragraph with a title, e.g. "Content search results"
- Go to the App section and select Query publisher as the app type
- Set Query to "Content - Content search.query"
- In the Template dropdown select the "ContentDropdownResponse.cshtml"
- Click Save and close
The page should now look something like this:
Linking the search column to this service page will only give content pages as results.