We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    What I’m trying to do is create "Category" pages for a website. On these "Category" pages, products will be listed out using Ditto...no problem so far. Now here’s the thing I’m trying to work around in the Manager area of MODx: these products will sometimes will appear on multiple "Category" pages depending on whether or not that product falls under that particular category, so I can’t exactly just have the products be children of that specific category b/c they need to be listed on sometimes multiple category pages as well.

    The way I’ve set the site up in MODx so far is to have a container named "Products". The manager will add products as children of this "Products" container. In a different part of the manager area, I’ve got the different categories with no children listed under them. So my thought was to have a filter clause on each category page and have T.V.’s on the products themselves where the manager could enter the ID to the category page itself. Then when the Ditto call on that particular "Category" page is called, it will go to the "Products" container and view the children that have the ID for that particular category page. If it does, then it will pull that product onto that particular category page. Is there a better or easier way to do this from what I’m doing? I just assumed this would make the most sense.

    I started a topic already this filter clause (seen here: http://modxcms.com/forums/index.php/topic,27739.0.html), but I’m not sure that is the easiest solution to what I’m trying to achieve.
      Precision Web Development ... SmashStack.com
      • 7231
      • 4,205 Posts
      Use tags and Dittos built in tag filtering mechanism.

      There is a cool screencast on tagging that has some ideas on doing this. Also I think that the demo site may use the tagging filters.

      Check out the documentation on the tag parameters in Ditto.

      This is just one way to do it, which is almost a variation of your original idea but using tags rather than filters.

      Tip: any template/document variable can be used as a tag source.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 4749
        • 623 Posts
        I’ve done this same thing I believe. Here’s the ditto call I’m using:
         [!Ditto? &parents=`8,12,44,180,181,182,183,184,185` &tpl=`categories` &tagData=`***PUT ALL YOUR TV's HERE***` &tagDelimiter=`,` &tagMode=`onlyTags` &tags=`[*longtitle*],[*menutitle*],[*description*],[*pagetitle*]` &display=`2` &extenders=`dateFilter` &dateSource=`pub_date` &dateFormat=`%B %e, %Y` &orderBy=`pub_date DESC` !]


        I wanted to associate all articles with any keyword with the product, kind of like a "compare to" for each product or "related article" on the product. This finds all the documents related to the one that’s currently displayed. This way it doesn’t matter where the documents are teh &parents will define where they can be found and as long as the products are tagged properly you can sort and display them anywhere automagically. Hope this helps.
          The MODx has you...
          Utah Web Design
          • 33982 ☆ A M B ☆
          • 476 Posts
          Perfect...thanks everyone...I feel like after using MODx almost 2 years, I still have so much to figure out (and I do!).

          So what I did was used this Ditto call:

          [!Ditto? &startID=`49` &tpl=`category_tpl` &tagData=`category1,category2,category3,category4` &tagMode=`onlyTags` &tags=`[*id*]` &display=`9` &sortDir=`DESC` &depth=`1` &sortBy=`menuindex` &paginate=`1` &paginateAlwaysShowLinks=`1`!]

          I was able to use " &tags="`[*id*]` " to specify the id of the given Category page for which Ditto was being called. Then if the T.V. on the product page in &tagData matched up (this is where the manager will enter the unique ID of the Category page itself) with the unique ID of the Category page, that product will be pulled from the Products container.

          Works great...thanks a million!
            Precision Web Development ... SmashStack.com
            • 4749
            • 623 Posts
            Cool. It’s nice to finally get something working.

            I feel much the same way. I’ve been using modx for just over a year now and feel like such a novice. I know Shane responded to your post too. He’s helped me many times before. Thank goodness for such an active community or I’d be lost. It’s the biggest reason I chose ModX over many others.
              The MODx has you...
              Utah Web Design
              • 7231
              • 4,205 Posts
              I feel much the same way. I’ve been using modx for just over a year now and feel like such a novice.
              Get used to it, MODx being so flexible it is virtually impossible to know everything, there will always be some cool new way to do something.

              MODx community rocks.  grin

              Edit:typo
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 33982 ☆ A M B ☆
                • 476 Posts
                Hey Shane,

                Thanks so much...you’ve definitely been bailing me out a lot lately...I owe you one...MODx really does have an amazing and helpful community.

                Thanks!
                  Precision Web Development ... SmashStack.com