We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • This is an auto-generated support/comment thread for CSS Star Rating.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    This snippet lets visitors to your site vote on your web articles using a completely CSS based star rating.
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
      • 18436
      • 135 Posts
      I seem to be getting a url error when using this with friendly urls and friendly paths enabled:

      an example of the url being generated by the makeurl function:
      http://localhost/development/swellguys.co.za/new.html?starvote=2&pid=263


      which should be:
      http://localhost/development/swellguys.co.za/dev/new.html?starvote=2&pid=263
      • Hi Marschant,

        If you substitute any occurrences of $modx->documentObject[’alias’] in the makeUrl calls with an empty string (’’) then that should solve the issue.

        Thanks for the bug report ... any problems then let me know. I will get the main package updated tomorrow with this fix.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 18436
          • 135 Posts
          Confirmed, did this last night and it worked, might I suggest checking the "use friendly alias path" settings and outputing different url strings based on that?
          • No need ... removing the alias value will allow it to be used for all combinations of friendly url settings. smiley
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 6926
              • 41 Posts
              Hi,
              First of all, thanks for developing such a cool snippet.

              I have facing one strange problem with it, I added the star_rating with onevote parameter but it still allows me to vote more than one time i.e. it counts the 2nd vote...

              I have used following parameters:

              [!star_rating? &onevote &docID!]

              I also tried using: [!star_rating? &useSession &docID!]

              but none of them helped me.

              Please suggest the solution.

              Thanks
              Deep
                Deep Ganatra
                Web1 Solutions
                • 6726
                • 7,075 Posts
                I never used Start Rating, but usually snippet calls need a value assigned to the parameter... I guess you’re still learning MODx there. Check out the doc, it helps getting through the basics smiley

                If you look at the snippet page, you’ll see that the &onevote parameter seems to be a boolean : i.e can only be either set to true or false &onevote=`1` or &onevote=`true` I guess. When the parameter is set to true, it seems the snippet uses cookies to remember the vote (thus, not allow multiple votes).

                The &docID parameter is optionnal, only if you need to retrieve the star rating from another document. Then you should use it like this &docID=`5` if the document you want to use has the ID : 5 (see in the document tree the number in parentheses).

                I’ll let those who actually used the snippet get into more detail.
                Hope it helps smiley

                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 6926
                  • 41 Posts
                  oh my bad, you were right. I missed the =’1’

                  Thanks
                  Deep
                    Deep Ganatra
                    Web1 Solutions
                    • 6726
                    • 7,075 Posts
                    Glad I could help smiley
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                    • lol, I just typed out almost to the word what David said in his post - beat me to the posting though laugh

                      It doesn’t matter what value the &useSession and &onevote parameters are given, the fact they are specified in the snippet call will trigger the relevant functionality.

                      The &docID parameter is, as David mentioned, for remote page voting and was something that was used in the designing of the MODx Repository. I know that somebody did once mention a Ditto/Star Rating combo but I’m not sure if they ever got anywhere with it ...

                      Glad you got it working Deep! smiley

                        Garry Nutting
                        Senior Developer
                        MODX, LLC

                        Email: [email protected]
                        Twitter: @garryn
                        Web: modx.com