Product and content search results
The Product and content search 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 shows both products and content pages:
Manual setup
This guide will go through the manual setup process for a product and content search results service page.
First you must create the service page:
- 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. "Product and 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 the product and content search rows.
Firstly, we will add the content search row:
- Add a new row to the service page
- Add an App paragraph to the row
- 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 Display section, set the amount of content pages you want to show
- In the Template dropdown select the "ContentDropdownResponse.cshtml"
- Click Save and close
Secondly, we will add the product search:
- Add a row to the service page
- Add an App paragraph to the row
- Provide the paragraph with a title, e.g. “Product search results”
- Go to the App section and select Product Catalog for ViewModel as the app type
- Set Query to "SwiftProducts - Products.query"
- In the Display section, set the amount of products you want to show
- In the Template section, set the List dropdown to “ProductSearchDropdownResponse”
- Click Save and close
you page should now look something like this:
Linking the search column to this service page will give both products and content as results.