• Resolved Erfan MHDi

    (@erfanmhd)


    Hello,
    Thanks for your great plugin, i’m really enjoying of working with it specially the options that plugin has to customize makes creating really enjoyable.

    i got two questions to ask and i appreciate it if your can help me with these:
    1. inside templates/review.php can i start a loop to add a custom numeral id to every review item ?
    i need to make each one of them unique so i can target them with jQuery and CSS.
    2. if seen “site-reviews/review/created” Hook and it triggers when a form is accepted and fields are filled with valid data, is there any hook for submit button clicked and field data is not valid (Error Mode).

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    1. Each review has a unique Post ID from the database, and the review.php template has access to the Review object, so you can simply do this in the template to echo the review ID:

    id="review-<?= $review->ID; ?>"

    2. Can you give me a use case?

    • This reply was modified 4 years, 1 month ago by Gemini Labs.
    Thread Starter Erfan MHDi

    (@erfanmhd)

    1. Awesome, that was exactly what i need. Thanks!
    2. in my case the new review submission form is loading inside a popup with static height like height: 400px; which is generating with jQuery when popup box trigger clicked and opens, i cannot change height to any dynamic value like auto or fit-content because of my html structure. when i click on submit button the error messages on bottom of every field make the box height more than what it was when the popup box opens and it gets scroll inside popup box. in order to remove the scroll i need to change the static height value of popup box upon error messages is generating, or i need to have a live jQuery generating static height upon review submission form container changes i guess…
    please do tell me if you have a better solution for this case.

    Thanks alot.

    Plugin Author Gemini Labs

    (@geminilabs)

    If you are using a fixed height in order to centre the popup in the browser viewport, you should really consider using CSS flexbox positioning instead to centre the popup.

    Site Reviews uses both frontend and backend validation. In order to do something after frontend validation (performed before the form is submitted), you will need to watch for a click event on the submit button.

    To do something after backend validation (when the form is actually submitted), you can listen for the custom javascript event site-reviews/after/submission that is triggered after the ajax call.

    Here is an example from the Site Reviews v5.0 FAQ page that shows this javascript event in use:

    Thread Starter Erfan MHDi

    (@erfanmhd)

    Thanks for your advice.
    by the way i have to say that i’ve tested lot’s of review and rating plugins and none of them was as light and customizable as yours. the method of your plugin and the way it assigns review to post and the site owner response … just what i needed.
    your plugin makes everything better for me dude.
    Good Job and i wish you big time success ! ??

    Thread Starter Erfan MHDi

    (@erfanmhd)

    sorry but i got one last thing to ask,
    any chance we can have infinite scroll for ajax pagination?
    i want the page 2 of reviews to load automatically when webpage scrolls to bottom of current review page.

    Plugin Author Gemini Labs

    (@geminilabs)

    Infinite Scrolling is best suited for content discovery. I would not recommend it for reviews or comments unless you are using them to drive user engagement.

    There is much on discussion about this topic online and how in many cases Infinite Scrolling is bad UX.

    See also: https://uxplanet.org/ux-infinite-scrolling-vs-pagination-1030d29376f1

    Thread Starter Erfan MHDi

    (@erfanmhd)

    hello,
    yup, i agree. but as i’m not loading reviews on page with footer. and they are being loaded on a full screen push box inside my product page and i got no footer on push box it’ll be nice to have an infinite scroll instead of pagination or even ajax pagination.
    thats why i asked for it my friend.
    can you give me a hint on how to do this ?

    Plugin Author Gemini Labs

    (@geminilabs)

    Infinite scrolling is not possible with the provided shortcodes using pagination.

    You will likely need to use the glsr_get_reviews function (see the Site Reviews > Help > Functions page) and write some javascript to perform the infinite scrolling.

    Thread Starter Erfan MHDi

    (@erfanmhd)

    Thanks ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Add Custom ID to each Review Item’ is closed to new replies.