We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22840
    • 1,572 Posts
    Hi All,

    Right, straight to the point.

    I have a site that has / will have about 3000+ businesses on it, now each business has its own page where people can leave comments on the business.

    What I want to do is be able to pull the latest 10 comments onto the home page.

    Now I’ve had a read through the forums but can’t seem to see where I can call the latest from all pages. and get them on the home page with a link back to the pub /Garage ect.

    Any help / pointers would be great.

    I’n using jot 1.1.3 and the latest modx

    Ta
      • 22840
      • 1,572 Posts
      Right,

      I’ve managed to get comments on the home page by using a chunk:
      <li style="width: 700px; list-style-type: none; margin: 10px 20px;">[+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=``+] commented on [+comment.title:limit:esc+]<br />
      [+comment.createdby:isnt=`0`:then=``+][+comment.content:wordwrap:esc:nl2br:limit=`100`+] ...<br />
      <a href="[~[+comment.uparent+]~]#jc[+comment.id+]">Read More...</a></li>


      and then a jot call like this in my template:

      [!Jot? &placeholders=`1` &output=`0` &tplComments=`latest_tpl` &sortby=`createdon:d`  &pagination=`0` &css=`0` &docid=`346` !]
      <div class="home_comments" style="margin: 10px 20px;">
      <h2>Latest Comments</h2>
      <ul class="latest">
      [+jot.html.comments+]
      </ul>
      </div>


      Now I can only get this to work by adding the id of the document, if i add &docid=`*` it returns nothing.

      Is there a workaround for this ??

        • 33337
        • 3,975 Posts
        Where did u get &docid=`*` from?
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 33337
          • 3,975 Posts
          Ok, I think the idea didn’t make into public release yet, you may need to consult : http://modxcms.com/forums/index.php/topic,15746.0.html

          Happy Jot-ing! laugh
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 22840
            • 1,572 Posts
            Hi Zi,

            Thanks for replying, I’ve alreday seen that post however none of the solutions will work for me.

            Rachael’s is for 1.1.2 and Bruno17’s enables you to add multiple docs, however I would have to add about 3000 then edit it every time I added a new one so that’s of no use im afraid.

            Thanks for looking though.
              • 33337
              • 3,975 Posts
              Quote from: paulp at Dec 04, 2008, 02:43 PM

              Hi Zi,

              Thanks for replying, I’ve alreday seen that post however none of the solutions will work for me.

              Rachael’s is for 1.1.2 and Bruno17’s enables you to add multiple docs, however I would have to add about 3000 then edit it every time I added a new one so that’s of no use im afraid.

              Thanks for looking though.

              I don’t know if it will accept 3000 as in the snippet call, but if this can be the possibility, there is a work around.

              put &docId=`{{docids}}` , and add a Ditto call to list all 3000 docs with comma as a delimiter. Somehow very dirty, but if it works then its great! until Jot gets the * fix. tongue
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 7231
                • 4,205 Posts
                With 3K documents I would recommend a custom query. It seems way over the top to to only retrieve the most recent comments. Take a look at the queries used in the recent comment module to get some ideas.
                  [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&#39;t know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                  • 22840
                  • 1,572 Posts
                  Thanks for the answers both, but I think it would be easier to just downgrade to 1.1.2 untill jot can support this. However I don’t think that there will be a upgrade untill Reveloution is released.

                  Is there a downside to me downgrading to get this feature, all I need is the facility for someone to post comments with the captcha to stop spamming, have them all moderated via JoCo and pull them to the home page.

                  Ta
                    • 22840
                    • 1,572 Posts
                    Does noone have a link to 1.1.2 huh
                      • 28245
                      • 20 Posts
                      I have

                      Look below