We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    OK, I think I know where we’re getting confused. I’m not using Ditto in this instance. It’s just a chunk pulling the existing information from the page. So, in my template I have:
    {{masterDir}}

    There isn’t a Ditto call creating that information. It’s just a set table with a certain number of rows from the page TV’s. So, then why wouldn’t Related work? It should work, right. Related populates the checkboxes on the page and when checked the chunk in the template should return what I’m asking for, right? There is no Ditto call making it more complex, it’s just your standard TV. Thanks Mark.
      The MODx has you...
      Utah Web Design
      • 29774
      • 386 Posts
      @cbaone

      sorry, I confused {+..+] placeholders for tvs [*..*] - doh.

      You can just use the getField snippet and you’re done:

      <table id="master_dir" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th scope="row">Size</th>
          <td>[!GetField? &docid=`[*size*]`!]</td>
        </tr>
        <tr>
          <th scope="row">Color</th>
          <td>[!GetField? &docid=`[*color*]`!]</td>
        </tr>
        <tr>
          <th scope="row">Shape</th>
          <td>[!GetField? &docid=`[*shape*]`!]</td>
        </tr>
        <tr>
          <th scope="row">Texture</th>
          <td>[!GetField? &docid=`[*texture*]`!]</td>
        </tr>
      </table>
      


      I thought you were doing something more complicated like outputting a big paginated table of all your products and related data with Ditto, which is actually a very interesting problem. For the next version of Related I think I’m going to amend some of the tag functionality so it can be used to grab any field for any related tag, either in the manager or on the website front end. So thanks for sending me down this interesting path, even if it was by accident smiley
        Snippets: GoogleMap | FileDetails | Related Plugin: SSL
        • 4749
        • 623 Posts
        Well, actually... Keep going down that path, because shortly I may have need for it. grin

        The site that I’m working on will have a more complex "ranking" system for products based on tags and other things. I think your idea may very well be the solution to that too. Thank again for all your help.
          The MODx has you...
          Utah Web Design
          • 14463
          • 11 Posts
          Hi

          I use related and it works very well ! Thanks for sharing !

          Could you tell me if related manage multiple select with checkboxes ? (in documentation we can read in advanced example: "[...] and assign to people one or more departments".

          I ask this question because i try multiple select and it doesn’t work for me.

          JohannB
            Slow, But Sure
            • 14463
            • 11 Posts
            I found the response : Related manage multiple select with checkbox !

            When you choose checkbox for your TV, don’t forget to precise the widget ---> delimited list.

            JohannB
              Slow, But Sure
              • 28544
              • 1 Posts
              The plugin page for Related appears to be a blank document; at least that’s what I see when I access http://modxcms.com/extras/package/?package=372
                • 29774
                • 386 Posts
                Hmm, not sure what’s going on there. I’ll try to reupload it later today.

                  Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                  • 19309
                  • 49 Posts
                  I tryed to test Related with Evolution 1.0.2. But instead of seeing a list off possible related objects when editing a document, I only see this error message:

                  Fatal error: Call to a member function runSnippet() on a non-object in /www/htdocs/w00bec78/testinstallationen/txnewsletters/assets/snippets/related.php on line 29


                  I use the latest version of the script which was posted here in the forum. That’s why it says line 29. In the original script it is line 73.

                  The error message refers to the following line in the script:

                  $ultimateParent = $modx->runSnippet("UltimateParent", array("id"=>$id, "topLevel"=>$topLevel));


                  Any ideas how to solve this?
                    • 29774
                    • 386 Posts
                    Try adding

                    global $modx;

                    at the top of the code - let me know if that works
                      Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                      • 31381
                      • 31 Posts
                      Hi,

                      very cool Snippet.

                      I have to questions:

                      1) I would like to use checkboxes to let people check multiple relations.
                      Can you think about a way to make the checkboxes something like a tree - so that people could see which level in the document-tree the document has.

                      2) Is there a way, to list the chosen documents separated by for example commas (,) so I could let Ditto but them for every docoment as "see also there" links. At the moment a nice long number will be output after choosing more than one document.