Hi,
I’m trying to convert a site into modx and I’m running into some problems..
The document structure is:
Category1 -> Subcategory1 -> Product 1
-> Product 2
-> Subcategory2 -> Product 3
Category2 -> Subcategory 3 -> Product 5
So I have a list of parents with children and childrens children..
I need to create an index when clicking on a category, where the user will see the underlying subcategories as headers to lists with the products in the subcategories.
Ex when clicking on link to Category 1 document:
CATEGORY 1
Subcategory1
<li>Product 1</li>
<li>Product 2</li>
Subcategory2
<li>Product 3</li>
I’ve tried using depth which lets me show poth subcat and product but I only seem to be able to assign one ditto-template and it then shows both subcat and product as list-button.
I’ve also tried using ditto on the subcategory, retrieving the list of products and then calling the content of the subcategory in another ditto-template on the Category but when I run it, the Category fetches the Ditto-call and not the output in the content of the subcategory so I end up calling the same child in both header and list..
Can anyone help me to nail this? There is probably an obvious solution to this but I can’t seem to figure it out..
Embed a second ditto call or a wayfinder call inside the original ditto template chunk to generate the inner list. Remember to alternate snippet cached [[ ]] and uncached [! !] in order to get both calls to work.