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

    Can’t seem to get my comment count to display the right number of comments on the main blog entry page, its does on the blog overview page. Here is what I have on the main blog page:

    Ditto call:

    [[Ditto? &startID=`4` &summarize=`5`  &tpl=`blog_mainpage` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]


    Here is the blog_mainpage tpl, set up as a chunk:

    <div class="blogentry">
    <h2><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h2>
    [+introtext+]
     <div class="meta" ><strong>Posted on</strong> [+date+] 
    <a  href="[~[+id+]~]#commentsAnchor">Comments ([!Jot?&docid=`[+id+]`&action=`count-comments` &canpost=`Registered Users`!])</a>
    </div>
    </div>


    This displays the comments great on the overview page.

    Now what I have for the actual article page is a template variable with the following:

    <div id="meta2" ><a  href="[~[+id+]~]#commentsAnchor">Comments ([!Jot?&docid=`[+id+]`&action=`count-comments`!])</a>
    </div>


    The above returns a comment count of zero every time. I know I am doing something wrong, just can’t figure out what at the minute. Only been playing with jot for a day or so.

    Any help would be great. I am using the latest version of both MODx and Jot.

    Thanks
    Lee
      http://www.blend.uk.com | Web Design by Blend
      • 7923
      • 4,213 Posts
      You cannot use [+id+] placeholder in the TV.. it’s Ditto’s placeholder. Replace that with [*id*], so your TV content would be:

      <div id="meta2" ><a href="[~[*id*]~]#commentsAnchor">Comments ([!Jot?&docid=`[*id*]`&action=`count-comments`!])</a>
      </div>
      


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 17717
        • 433 Posts
        That worked perfectly, trust me to get my snippets mixed up, thanks for that.

        Lee
          http://www.blend.uk.com | Web Design by Blend
          • 17717
          • 433 Posts
          What about the date, how would that display on the article via ditto? Its not actually using ditto to pull it in at that stage, is there a generic MODx date tag that would display a publish date?

          Thanks
            http://www.blend.uk.com | Web Design by Blend
            • 25663 MODX Staff
            • 12,272 Posts
            [*pubdate*] (see here for a list of all: http://modxcms.com/document-tvs.html) which you can format with PHx: http://modxcms.com/document-tvs.html

            Altenately use placeholder mode with AuthorTimestamp: http://modxcms.com/AuthorTimestamp-693.html
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me