Hi,
I’m new to Modx (usually a Joomla/Wordpress guy) but am impressed so far with the system. I’ve started to put together a bit of a product catalogue using some simple packages (getResources, getPage, Breadcrumbs, etc.), anyhow I’m having a few troubles setting it up exactly how I want.
I’ve got categories set up with a category template and products with a product template. One desire is to have a product (resource) shown in multiple categories, now obviously you could just duplicate the resource but then there are 2 resources which need updating, not ideal. I’ve looked at symlinks which effectively does what I require, but on the category pages I am using getResources to produce a list of products in that category, obviously the symlink’d product doesn’t show in the list with the real products.
Anyone have any ideas to get round this? I might even be approaching it from the wrong angle. Is there a better way?
Also I’m using getPage to provide page turning on category pages, the code works fine on a template but not when moved to a chunk, any idea why this might be?
Thanks
you can put all your product-resources under one folder ’products’ and use for example a checkbox-tv with your categories as input-options for your categories.
Then its possible to filter all resources by this category-TV.
getPage should work in a chunk the same way as in your template directly.
Can you tell a bit more about your template and chunk? some code?
Quote from: baj at May 24, 2011, 11:41 AM
That’s interesting, I hadn’t thought about the possibility of doing it that way. How would I create the category tree structure of pages on the front-end though? For example I’ve got categories, sub-categories and even sub-sub-categories. How would I create these pages from a list of tv-categories? I’m also using Wayfinder to produce the navigation, that wouldn’t work either would it any more?
you can let your category-tree, as you have it now, but without resources in them.
So you can still use wayfinder to produce the category-navigation.
Then you can use the Tree-structure to get your input-options for your category-TV with some code and @EVAL-binding.
In Theorie its also possible to create a special category-TV which presents your category-Tv as a Tree with checkboxes.
Perhaps its also worth to try Visioncart for your project.
Quote from: baj at May 24, 2011, 11:41 AM
Which is called from my template using the following:
[[!If? &subject=`[[getResources? &parents=`[[*id]]` &where=`{"template:=":2}` &depth=`0`]]` &operator=`!empty` &then=`[[$CategoryLoop]]`]]
It was previously working when all within the template, but I moved it so that I cold have logic to not show the section header if no results exist.
is thisone working?
[[!If? &subject=`test` &operator=`!empty` &then=`[[$CategoryLoop]]`]]