We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34404
    • 3 Posts
    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
      • 4172
      • 5,888 Posts
      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?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 34404
        • 3 Posts
        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?

        This is the getPage that doesn’t seem to work in a chunk:

        <h2>Sub Categories of [[*id]]</h2>
        [[!getPage?
           &elementClass=`modSnippet`
           &element=`getResources`
        
           &parents=`[[*id]]`
           &where=`{"template:=":2}`
           &depth=`0` 
           &limit=`5`
           &pageVarKey=`catpage`
        
           &tpl=`CategoryItem` 
           &includeTVs=`1` 
           &processTVs=`1` 
           &includeContent=`1` 
           &sortby=`menuindex` 
           &sortdir=`ASC`
        ]]
        
        <div class="paging">
        <ul class="pageList">
          [[!+catpage.nav]]
        </ul>
        </div>


        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.

        Thanks for your help
          • 4172
          • 5,888 Posts
          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.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 4172
            • 5,888 Posts
            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]]`]]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 34404
              • 3 Posts
              Quote from: Bruno17 at May 24, 2011, 01:22 PM

              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.

              Ah yes, I see how that could work. It might be confusing for the client though when managing the catalogue. For example to add a new category you’d have to add a resource and also a category-tv value, not the most logical of steps.

              How could I create a special category-TV of checkboxes which represented my resource list tree?

              Thanks