Perhaps I approached this wrong but I'm hoping someone can set me on the right path while I struggle to make this work...
First, I have a categories page that I setup a relation to products. On the products page I have an image gallery that's I've also created a relationship within.
What I'm trying to accomplish is to list each product on a category page. This works fine. Next I'm trying to reference the first image from the related galleries of the products and this is where it fails. If I just make a cms:pages call it will pull from the entire pool of images and each product gets the same image. If I attempt to make a cms:reverse_related_pages call like I do from the products page I get an error because the category page doesn't have a relation to the gallery.
Any assistance is appreciated. I'm thinking I may need to just tap into the db directly with a query but I thought I'd ask first.
thanks!
for reference:
First, I have a categories page that I setup a relation to products. On the products page I have an image gallery that's I've also created a relationship within.
What I'm trying to accomplish is to list each product on a category page. This works fine. Next I'm trying to reference the first image from the related galleries of the products and this is where it fails. If I just make a cms:pages call it will pull from the entire pool of images and each product gets the same image. If I attempt to make a cms:reverse_related_pages call like I do from the products page I get an error because the category page doesn't have a relation to the gallery.
Any assistance is appreciated. I'm thinking I may need to just tap into the db directly with a query but I thought I'd ask first.
thanks!
for reference:
- Code: Select all
<cms:reverse_related_pages 'cat_prod' masterpage='products/product-detail.php' orderby='sort_order' order="asc">
<div>
<!-- this is the part that's broken because the index page doesn't have a relation to the product gallery -->
<cms:reverse_related_pages 'product_photos' masterpage='products/template_product_gallery.php' orderby='sort_order' limit='1' order="asc">
<img src="<cms:show gg_image />" alt="">
</cms:pages>
<h3><a href="<cms:show k_page_link />"><cms:show product_name /></a></h3>
<a href="<cms:show k_page_link />">Learn More</a>
</div>
</cms:reverse_related_pages>