Search

Below each product have a list of related products. How can I make this relevant product list does not show the current product?

Ds call is based on the product page by URL filter, in fact, the list of related products also use product-list ds, but I do not know how to use filters.

I'll make a couple of assumptions here, but this should be relevantly straightforward to solve using a concept known as Data Source Chaining.

I assume you have a Products section that is using a Select Box Link or equivalent field to link to itself. This field might be called "Related Products". To accomplish your goal two datasources are required, one for the Product Details, and one for the Related Products.

Considering a URL, example.com/products/view/red-toolbox/, this requires a page that has a single url parameter, product. The first Datasource, Product Details can then filtering on the Product Name using the {$product} syntax. To get all the related products, this datasource will create an output parameter on the "Related Product" field. This is done by selecting the $ds-product-details.related-products option in the Parameters section of the Data Source Editor.

We can now create our second Datasource, "Related Products by ID". This should be from the same Products section, but your filter will now be on the System ID 'field', and it should use the output parameter we created before, $ds-product-details.related-products to fetch the relevant related products :)

Hope that helps!

ok, you mean I need to add a related-products field in the product sections? I know that this approach is possible.

Because this site just very few product, not even product categories. In addition to this the way to create a field that can not be directly ds filter to achieve this functionality?

Sure, it's possible, but you'll need to do mostly the same steps.

The Product Details datasource will output the system-id and then your Related Products DS should use a System ID filter with the value not: $ds-product-details.system-id.

The only way to do this without using Filters is by filtering in the XSLT, and at this point I'd simply say, "why not learn to use filters?" :)

brendo's right! Data Source Chaining is powerful enough to learn and use it.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details