We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31037
    • 358 Posts
    Is there now a function in Jot to be able to list all comments (to list for exampla latest 5 comments from all documents) or should I write my own snippet for that?

    If the answer is "write your own" it would be great if someone who has created such could post it here? Saves time to have something to start with! smiley
      • 17883
      • 1,039 Posts
      No need for a new snippet...

      just add &docid=`*` to your JOT call.
        • 31037
        • 358 Posts
        Strange, I tried that first with no success. But now when I know it should work I can start to look for the problem (or the solution maybe tongue).

        Thank you for the reply! smiley
          • 17883
          • 1,039 Posts
          Tell me if it doesn´t work. Then I´ll post all the stuff I have on my site. (www.mademyday.de/neu/ right column, there it is)
            • 31037
            • 358 Posts
            I don’t know German, but I sure see that you got it to work! smiley

            For me it doesn’t work, I’ve tried it like this:

            [!Jot? &docid=`*` &placeholders=`1` &output=`0`!]
            [+jot.html.comments+]

            If I put an page id instead of * it works fine.

            So if you have any idea, please let me know! smiley

            Danke schöön!
              • 17883
              • 1,039 Posts
              Hi Uncle,

              chunk with the JOT call:

              [!Jot? &placeholders=`1` &output=`0` &tplComments=`latest_tpl` &sortby=`createdon:d`  &pagination=`0` &css=`0` &docid=`*` !]
              <div class="sidebox kommentar">
              <h3>Letzte Kommentare</h3>
              <ul class="latest">
              [+jot.html.comments+]
              </ul>
              </div>


              Template Chunk:

              <li><a href="[~[+comment.uparent+]~]#jc[+comment.id+]"><strong>[+comment.title:limit:esc+]</strong>: [+comment.content:wordwrap:esc:nl2br:limit=`100`+] ...von <strong>[+comment.createdby:isnt=`0`:then=``+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=``+]</strong></a></li>
              


              There seems to be no difference... strange. My JOT version is 1.1.1., perhaps this is the difference.
                • 25215
                • 32 Posts
                I’m getting the same problem. I tried using your exact code (snippet call and template) and still get no comments returned on home page. If I specify a particular document it works but when trying a parent folder or * then no comments are returned.

                Everything else workds great it’s just the:

                &docid=`*`


                That doesn’t seem to work.

                Just upgraded to the Latest Jot so it can’t be that. Still on MODx 0.95 for this project though.
                  • 24292
                  • 28 Posts
                  I’m using Jot 1.1.2 and MODx 0.96 and needed to do this as well.
                  The following changes allow &docid=`*` to work, without messing anything else up.
                  In assets/snippets/jot/jot.class.inc.php, replace
                  $this->config["docid"] = !is_null($this->Get("docid")) ? intval($this->Get("docid")):$modx->documentIdentifier;
                  with
                  	if (!is_null($this->Get("docid")) && ($this->Get("docid") == '*'))
                  		$this->config["docid"] = '*';
                  	else
                  		$this->config["docid"] = !is_null($this->Get("docid")) ? intval($this->Get("docid")):$modx->documentIdentifier;


                  In assets/snippets/jot/includes/jot.db.class.inc.php
                  In function GetCommentCount, change
                  $sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE uparent = '.$docid.' AND tagid = "' . $tagid .'"'.$where;
                  to
                  	if ($docid == '*')
                  		$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE tagid = "' . $tagid .'"'.$where;
                  	else
                  		$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE uparent = '.$docid.' AND tagid = "' . $tagid .'"'.$where;

                  and in function GetComments, change
                  $sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where uparent = '" . $docid . "' and tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
                  to
                  	if ($docid == '*')
                  		$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
                  	else
                  		$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where uparent = '$docid' and tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;


                  Add &pagination=`3` to the Jot call to limit the number items returned.

                    • 14828
                    • 7 Posts
                    Will this modification included in the next Release of Jot. I don’t like to hack core files!
                      • 4195
                      • 398 Posts
                      yes but i still have to make time to create a new release. I keep log of all usefull hacks smiley
                        Armand Pondman
                        MODx Coding Team
                        :: Jot :: PHx