We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1266
    • 50 Posts
    Sorry for all the queries smiley

    I made the changes listed in the online documentation for YAMS + Jot as well as (I think) for Ditto. For each blog entry, I use this call to create the comments/comment form:

    [!Jot? &tagid=`(yams_id)` &moderated=`1` &canmoderate=`` &captcha=`0` &tplComments=`comment-item` &tplForm=`comment-form_(yams_id)` &notify=`1` &guestname=`guest` &customfields=`name,location` &placeholders=`1` &output=`0`!]


    That seems to be working fine and dandy. People can add comments, the moderation is working normally, and comments stay specific to the language they were added in.

    However on my main blog page, where I present summaries of each entry, I use a simple Jot call in the template to count the number of comments, and that refuses to change from 0. Here’s the Jot call for that (it’s inside an non-cacheable Ditto call):

    [[Jot? &action=`count-comments` &docid=`[+id+]` &tagid=`(yams_id)`]]


    Any idea what I’m doing wrong? I’m hoping to have the site on a testing server tomorrow, so I’ll be able to present a live example soon. I believe it worked before, but maybe something else is tripping it up.
      • 22851
      • 805 Posts
      I haven’t come across this before and I am not sure what the problem is I’m afraid. It looks like it should work to me... All the YAMS customisation of the Jot snippet does is to override the method that outputs URLs so that it outputs multilingual ones, so I’m pretty confident that’s not the problem. Jot outputs something, even if it is 0, so it’s probably not a caching related problem. Perhaps the [tt]count-comments[/tt] mode doesn’t respect the [tt]tagid[/tt] parameter - effectively a bug in Jot?
        YAMS: Yet Another Multilingual Solution for MODx
        YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
        Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
        • 1266
        • 50 Posts
        I’ll move it over to the Jot forum. Thanks!

        P.S. I really appreciate the responsiveness even when it’s not YAMS fault smiley
          • 22851
          • 805 Posts
          Okay. By the way, I just had a look at the jot code. It looks like it does support the tagid... so I’m not sure what’s up. The publish status of the document containing the comments looks to be important.
            YAMS: Yet Another Multilingual Solution for MODx
            YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
            Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
            • 1266
            • 50 Posts
            Just FYI…

            I did some more research, and this is interesting. The yams_id value is definitely getting stored in the DB in the tagid field. If I change my Jot call to [[Jot?…&tagid=`en`]], the call works fine. I randomly placed the (yams_id) placeholder in the chunk, and it’s outputting as the correct language id (en) everywhere I tried it. When I tried the Jot call as uncacheable (which I didn’t expect to work because of the call that it’s in), it renders as "[!Jot?…&tagid=`en`!]" so I _know_ the (yams_id) placeholder is working. weird.

            For the life of me, I can’t imagine why it doesn’t work with the placeholder in the call though. No reply yet on the Jot board.
              • 22851
              • 805 Posts
              Okay. So it could be a YAMS parsing issue after all. I’m away on a short break at the moment, getting back on Monday, so I’ll look into it early next week. If you’re able to specify the tagid explicitly in the meantime that would be good. Cheers.
                YAMS: Yet Another Multilingual Solution for MODx
                YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                • 22851
                • 805 Posts
                I just took a MODx 1.0.3 default install and YAMS-ified the ditto+jot blog section, which involved setting up jot and ditto in the manner described above with a comment count enabled.

                One thing to watch out for when doing this is that when an anchor is added to the syntax for a MODx link, for example [tt]"[~[+id+]~]#article..."[/tt], YAMS wont automatically identify it and generate a multilingual URL. In that case it can be made multilingual by replacing the MODx link syntax by [tt]"(yams_doc:[+id+])#article..."[/tt]. I had to do this within the ditto and jot templates. I also had to do something similar to the action attribute of the jot form to make sure that it posted to the correct page.

                Anyhow, the main point to note is that the comments function works fine for me and does display the correct number of comments for the given language. It’s quite frustrating, because it is the second time this week I haven’t been able to reproduce a problem that has been flagged up by a YAMS user.

                Out of interest, what versions of Jot and Ditto do you have installed? Cheers.
                  YAMS: Yet Another Multilingual Solution for MODx
                  YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                  Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                  • 1266
                  • 50 Posts
                  Hmm I’m not sure if that’s relevant to my problem, but it’s good to know!

                  I’m using Ditto 2.1.0 and Jot 1.1.4 (what came with Evo 1.0.3)