Developer forum

Forum » Swift » Swift – Separate search results page to override product catalog parameters (e.g. IsVariant)

Swift – Separate search results page to override product catalog parameters (e.g. IsVariant)

Ferri Halfhide
Reply

Context / Goal

We have a Swift 1.26.6 site with a standard /producten product list page. We want to configure a separate page as the search results destination so we can override certain product catalog parameters (e.g. only showing master products, not variants) that should not affect the default /producten page.

We modified Swift_SearchField.cshtml to respect the "Product list page" config field instead of always using GetPageIdByNavigationTag("Shop") — this part works correctly. The search field now navigates to whatever page is configured.

The question is: what is the right type of page to link to?


Approach 1 — New service page (tried)

We created a new page under Swift tools → Services and configured it as the "Product list page" in the Search Field paragraph. When navigating to it, the product results do appear, but there is no layout (no header, footer, styling) — just raw HTML. 
image


Is there a way to make a service page work as a full search results destination, or is this fundamentally the wrong approach?


Approach 2 — Duplicate of /producten (tried)

We duplicated the /producten page (which has a fully configured Product Catalog paragraph) and linked the search field to the duplicate. This works visually — layout, header, footer all render correctly. We can configure the variant filtering independently on this page.
image

However, we are unsure about the long-term impact:

  • Does the duplicate need a unique navigation tag? What breaks if it doesn't have one? What is the impact of this?
  • Are there other templates or JS that hardcode GetPageIdByNavigationTag("Shop") and would behave unexpectedly with two catalog pages?

Question

Which approach is correct for this use case? Is there a recommended pattern in Swift for having a secondary search results page with different product catalog settings?

Kind regards,
Ferri Halfhide


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

The second approach is correct. And you should have no url provider or navigation tag for that second page. On the second page you have the product catalog app - and you have to ensure you link a to a product detail page under the real /producten page.

If we had any recommended pattern it would be to have only one list - for search results and product list as one page.

Votes for this answer: 1

 

You must be logged in to post in the forum