Hi all,
I am using the getResources snippet to output products on a product category page. My menu tree looks as follows:
+ Product Categories
++ Category 1
++ Category 1
++ Category 1
In every chunk being output I need a link pointing back to its corresponding resource ("Category 1", "Category 2", ...):
"Product Categories":
Category1
Link to Category1
....
Category2
Link to Category2
...
Category3
Link to Category3
Unfortunately all I have been able to accomplish so far is a link pointing to the page where the snippet has been called ("Product Categories").
Below is my snippet call, the corresponding template chunk and a custom snippet I wrote to help me set the link. It would be great if someone could show me what I did wrong!
Snippet call:
[[getResources?
&tpl=`CHILLY-products-gallery`
&parents=`2`
&includeTVs=`1`
&sortby=`menuindex`
]]
Template [[$CHILLY-products-gallery]]:
<div><img src="[[+tv.CHILLY-product_category-image]]" alt="pic1" />
<p>
<b>[[+pagetitle]]</b>Some project details and blah blah blah
<a href="[[~[[get_id]]]]">Specifications...</a>
</p>
</div>
Snippet [[get_id]]:
return $modx->resource->get('id');
Cheers,
Stefan