My client wants to add products (as pages/documents) to productcategories. He creates his productcategories as containers/folders within the site tree.
Seems a simple request, but how do we display all these products on 1 page, ordered by category?
This is the tree-structure:
- Mechanics (folder/visible mainmenu-item)
1. turning (category/folder)
- turning machine 1 (document)
- turning machine 2 (document)
- turning machine 3 (document)
2. milling (category/folder)
- milling machine 1 (document)
3. assembly (category/folder)
- assembly machine 1 (document)
This is what he wants when "Mechanics" is selected from the main navigation:
<h3>turning</h3>
<div class="productsummary>turning machine 1</div>
<div class="productsummary>turning machine 1</div>
<div class="productsummary>turning machine 1</div>
<h3>milling</h3>
<div class="productsummary>milling machine 1</div>
<h3>turning</h3>
<div class="productsummary>assembly machine 1</div>
How do I display the category (folder/container) within the H3-tags with Ditto?
-
MODX Staff
- 1,535 Posts
In this instance, you’d be better off using Wayfinder unless you need something specific to Ditto. Wayfinder is highly capable of generating that output with the use of it’s templating system.
Garry Nutting
Senior Developer
MODX, LLC
Email:
[email protected]
Twitter: @garryn
Web: modx.com