-
☆ A M B ☆
- 24,524 Posts
I have much the same structure, except one more level under the subcategories, "Documentation" and "Downloads" to differentiate software from .pdf docs. Different pages offer different methods of access to the same downloads.
I've inherited pages full of hand-coded tables and/or ugly hand-coded Javascript in a multitude of chunks, and I'm trying to modify and organize everything so I can use static resources (files stored outside of the web root for added security) with a snippet or set of snippets to form lists and tables as needed from the Tree structure, only needing to drop in a new subcategory with its related batch of static resources, all in one place, to get the new items and their files into the various lists and tables. I think this will be very close to exactly what I need!
-
☆ A M B ☆
- 191 Posts
Cool; I'm glad you got it working!
I was going to say, that piece of code in my post above assumes all the resources are on the same level in the tree so having some at N and others at N+1 is what's messing it up. You could make something that'd handle those cases but you need more conditional logic than you can reasonably get with output filters in templates and you'd need to write a snippet to do it. You could start with setPlaceholders and modify it to work, using its class to do the work of retrieving all the various values.
But getting rid of the sub-sub category simplifies things enough that you don't have to do this.
Either way, I'm glad you've got it up and running now.
Oh, also there shouldn't be any reason to call setPlaceholders uncached (i.e. [[!setPlaceholders ...]]); a regular cached call will be better.