• Resolved brrto

    (@brrto)


    Hi!

    Thanks for the plugin, it does almost everything I need!

    I’m familiar with the afterVote strings for custom messages when a post is rated, and that’s working as designed. However, I’d like the message to show after rating to be rich HTML. In my use case, I’d like to say Thank you for rating this post. <a href="/some-page">Click here to complete a more in-depth survey</a> with a link to another page on the site. However, using HTML in the strings doesn’t render the HTML, it will just print the characters exactly as added in the string.

    I think there are a few options for solving this, but I don’t think any are available at this point, and I wanted to see if any of these can be added (or if I’m just totally missing this in the documentation).

    1. Pass the custom afterVote strings so that they display as HTML.
    2. Use Javascript to add a class to .rmp-rating-widget when a rating is submitted, similar to the .rmp-rating-widget--has-rated class that gets added on reload. This way, I can use a custom rating-widget.php template to show or hide sections based on whether a rating has already been submitted.
    3. Have a Javascript hook available when a rating is submitted.

    It didn’t look like this was available in the pro version either, but please let me know if I’m missing something or if this just isn’t something on the roadmap at all. Appreciate it!

    • This topic was modified 2 years, 8 months ago by brrto.
Viewing 1 replies (of 1 total)
  • Plugin Support Blaz K.

    (@blazk)

    Hi @brrto,

    I recommend using the custom rating-widget.php template. You can easily add a class to rating widget on your own. Something like this should work:

    
    $(".js-rmp-rating-icon").click(function(){
      $('.js-rmp-rating-widget').addClass("just-rated");
    });
    

    Now you’ll have “just-rated” class on rating widget after the post has been rated. So, with a few lines of CSS you should be able to display custom html after the rating.

    Regards,
    Blaz

    • This reply was modified 2 years, 8 months ago by Blaz K..
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Message After Rating’ is closed to new replies.