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

    I was wondering if it was possible to make Jot URL parameter sensitive.

    For example;

    index.html?id=12

    is a different page to

    index.html?id=13

    but I don’t seem to be able to make Jot see the difference.

    Can somebody please enlighten me?


      • 10473
      • 44 Posts
      I forgot to mention, I’ve using Jot version 1.1.2
        • 7923
        • 4,213 Posts
        I don’t understand what you mean.. Jot comments are different for each page, or actually for each &docid and &tagid.

        &docid is the current document by default. In that parameter you can define that to what document the comments are "binded". One document can have multiple different comment forms still by using &tagid to separate them.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 10473
          • 44 Posts
          Yes, jot comments are different for each page, if you create a a single page for each piece of data yoyu want to display, but say that you want to create a page which displays records from a table, and you would like to display different comments for each record, then there doesn’t seem to be any way of doing that.

          For example, you have a table of schoolchildren:

          create table modx_pupils(
          id integer not null auto_increment primary key,
          name varchar
          );

          and then you make a page pupils.html with the parameter id, so that the url looks like:

          pupils.html?id=1 etc.

          When I attach jot to the page, it only seems to use pupils.html as its point of reference, and not the whole URL.

          In other words, I get all pupil comments for every pupil page.
            • 7923
            • 4,213 Posts
            Yes, you will get same comments for all, because by default Jot binds the comments to the document ID. Like I said, you can use the &tagid to distinct the comments for each pupil.

            Do a snippet "pupilid" with this content:
            <?php
            return $_GET['id'];
            ?>
            


            And then in your jot call, use [!Jot? &tagid=`[[pupilid]]` .... !]


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 10473
              • 44 Posts
              I did that, and the jots comments are not saved at all.

              I added the result of the pupilid snippet to the page, so that it was displayed, and it worked fine, but Jot just doesn’t save the comment.

              It also generates as a target URL for the form pupil.html#jf5bc868a9 with no pupil id in it.
                • 7923
                • 4,213 Posts
                Do you have the snippet calls same as in my example, eg. the outer call uncached and the inner one cached?


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 10473
                  • 44 Posts
                  Sorry, for taking so long to reply, but I had a lot on at work.

                  Anyway, I have cut and paste your code into my page, and it simply didn’t work.

                  Without the tagid parameter the form is saved with no problems, but once it is included, the form stops saving.