We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello Everyone!!!

    I'm using LexRating, I think is a really good plugin, I recommend it!!!

    Everything works very well, comments, rates per comment, etc... BUT, I'm having problems trying to display the rating (in starts) of the current page! sad

    I'm using the LexRatingQuipPostHook code: http://rtfm.modx.com/extras/revo/lexrating

    I can see the right rate in the List (SEE IMAGE AT THE BOTTOM)
    list call:
    [[!LexRatingList? &name=`[[*alias]]` &group=`OverallRating`]]
    


    But if I try to display Only the rate for the current page, it display empty starts:
    list call:
    [[!LexRating? &name=`[[*alias]]` &group=`OverallRating`]]
    or
    [[!LexRating? &name=`[[*alias]]` &group=`OverallRating` &extended=`{"quipReplyId":"[[+idprefix]][[+id]]"}` &readOnly=`1` &tpl=`lexrating.quip`]]
    


    I try hundreds of options, uncached, cached, &name= ID instead alias, diffetent goups, etc... But nothing!!!

    The list ([[!LexRatingList) display the proper result, but the normal call ([[!LexRating) don't!

    I don't know how to take out the result from the list and only display the one that I need!

    Any help or any idea?

    Thank you very much, I would really appreciate any help!!! wink

      --
      ysanmiguel.com
    • How about this?
      [[LexRating?
      &name=`[[*alias]]`
      &group=`OverallRating`
      &initialAjax=`0`
      &readOnly=`1`
      ]]
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 33238
        • 388 Posts
        Thanks for your answer... I solve the problem, but not in the right way I think.. but works...

        I create a group for every page, replacing the general group OverallRating in Quip, I call the groups: [[*id]] and then I call the LexRatingList with the &group=`[[*id]]`. So LexiRating only display the group with that ID, and only exist one per page, so... Solved!!! smiley

        Thank you very much anyway!
          --
          ysanmiguel.com
          • 22673
          • 72 Posts
          Hi Ysanmiguel, do you think you could show us your code for your solution? I have the same problem but I cannot fix it using your solution. I don't think I am doing it correctly.
            • 33238
            • 388 Posts
            Hello Mate.

            OK this is my code, I hope is everything you will need to solve your problem.


            The code that I'm using to display the comments with the rate, using the hooks to link lexRating with Quip:

                                        [[!Quip?
                                        &thread=`[[*alias]]`
                                        &tplComment=`lexrating.quipComment`
                                        &threaded=`0`
                                        &useCss=`0`
                                        &gravatarSize=`70`
                                        &limit=`6`
                                        &sortDir=`DESC`
                                        ]]


                                        [[!QuipReply?
                                                &thread=`[[*alias]]`
                                                &postHooks=`LexRatingQuipPostHook`
                                                &tplAddComment=`lexrating.quipAddComment`
                                                &redirectTo=`[[*id]]`
                                                &moderate=`1`
                                                &recaptcha=`1`
                                                &disableRecaptchaWhenLoggedIn=`1`
                                                &closeAfter=`0` 
                                                &closed=`0`
                                                ]]


            And, this is the code to display the rate for every product (the one with the problem).

                                                [[!LexRatingList? 
                                                &name=`[[*alias]]`
                                                &group=`[[*id]]` 
                                                &tplListItem=`lexratinglist.item.custom`
                                                &tplListWrapper=`lexratinglist.wrapper.custom`
                                                ]]


            In the chunk: lexrating.quipComment

            You need to change this:

                        [[!LexRating?
                        &group=`[[*id]]`
                        &name=`[[+thread]]`
                        &extended=`{"quipReplyId":"[[+idprefix]][[+id]]"}`
                        &readOnly=`1`
                        &tpl=`lexrating.quip`
                        &js=``
                        &loadjQuery=`0`
                        &initialAjax=`0`
                        &_toArray=`1`
                        ]]


            And change this in the chunk: lexrating.quipAddComment

             <div class="rateComment">
                        <input type="hidden" name="lexrating_groupName" value="[[*id]]" />


            The Basic Idea is create group for each element, and tell lexRating display the results for that group, but every group contain only one article.

            That was my solution, works very well but obviously is not the proper solution.

            Cheers mate, I hope that works for you.
              --
              ysanmiguel.com
              • 22673
              • 72 Posts
              That's brilliant thank you Ysanmiguel!

              It now works. I can see that I put

              <input type="hidden" name="lexrating_groupName" value="[[+id]]" />

              instead of:
              <input type="hidden" name="lexrating_groupName" value="[[*id]]" />
                • 33238
                • 388 Posts
                Fantastic mate... Your Welcome!!!
                  --
                  ysanmiguel.com