Developer forum

Forum » CMS - Standard features » Products Under Category Headers - Only Show in Lowest-Level Categories

Products Under Category Headers - Only Show in Lowest-Level Categories

Alex Guo
Reply

Hi everyone,

We’re currently facing an issue with our category pages: products are being displayed under the main category headers, but we only want them to appear in the lowest-level categories (the actual product categories themselves).


If we hide the products, then they also hide under their lowest-level categories.

Ideally, we’d like to configure this through settings, is there a built-in way to prevent products from showing in parent categories? Or is this only achievable by modifying the templates?

Thanks in advance,
Alex


Replies

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

You can do that by changing the query you use for product lists.

By default it looks like this - which means it will find products in the current group or below:

If you change the query to this:

The list will only show products in the current group and leave out products from child groups.

Votes for this answer: 1

 

You must be logged in to post in the forum