Forum

Thread tagged as: Runway, Shop

Back to products in category

How would I go about creating a back link to other products in perch shop?

If I am displaying a product /shop/products/myproduct and it could belong to more than one product category. How could I create a link to go back to the products listing of the other products in the same category as the product page was arrived at from.

For example /shop/category/cat1 or /shop/category/cat2 depending on which one was originally being viewed before the product details (product.html)

Greg Riley

Greg Riley 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you trying to interrogate the browser history or to just link to a logical parent?

I would rather do it in Perch than browser history if possible? That way the link could say something like "back to all cat1 products" or "back to all cat2 products".

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, but is the aim to target where the user has come from, or what might logically be the ancestor? Those two problems aren't the same.

Logically by the ancestor. As thinking about it more, I may want to have more than one back link on the product so I would have have back to cat 1 and back to cat 2 in my example.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. Are you able to output the category paths?