• Resolved SYPOMark

    (@sypomark)


    Hi there,

    I’m using Rich Reviews on my site and finding it very user friendly. But I have a small customisation issue that I would appreciate some help with.

    I’d like to display recent reviews on a testimonials page. It’s all working fine, except I would like to alter the order that the parts of the review are served in. I would like to display the reviewer’s name above the star rating and the date.

    What is the best way to achieve this? I have so far tried using jQuery, insertAfter, and this SORT OF works, but displays the star ratings and date twice.

    The site link is: https://sypotest9.co.uk/testimonials/

    Thanks in advance for your help.

    With kind regards,

    Mark

    https://www.ads-software.com/plugins/rich-reviews/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Nuanced Media

    (@nuanced-media)

    Mark,

    So if I understand what you are looking for I think I have a cleaner solution for you. So all of the form fields are called and set in order by actions and filters, you could try rearranging the order in which each action is called, however I would advise to be careful because some of the actions are nested inside others. For instance the “review head”, which contains the rating, date , and title, is a separate nested bundle of actions than the “review content”. Also the markup is hence distributed across multiple actions, so there is a chance that accidentally removing an action could leave unopened divs, or uncleared floats, or something of that manner. I would suggest rather than trying to move the name display, simply leveraging the “title” field, which is already displayed where you want the name as the name, since as is it doesn’t look like you are collecting a title for the reviews/testimonials. So since the fields are editable, simply make the title field in the options labeled Name, set the other fields you want (i recommend collecting n email if you are not going to use user integration). And then just by using the title field to collect names, you get to this point by default (https://puu.sh/oeEpk/61b9f185e4.png). Then since you are using the title field to collect a name, and the plugin think you aren’t collecting name at all, it is displaying “Anonymous” since that is being input by default for the ‘author’ field of the review, you can then just use jQuery.

    jQuery(function() {
            jQuery('.rr_review_name').remove();
    });

    To remove the author credit from the bottom of the content and getting you here: https://puu.sh/oeFnk/bfe7478f83.png

    Note: This is not a perfect solution, but get’s the visual layout effect that you want. There’s is a degree of misattributing data, given the usage of the title field and the name field, so this will be reflected in the structure of rich schema associated with your individual review display. The only way to avoid this, would be customizing the display of the review body yourself, effectively rewriting /shortcodes/rr-show.php.

    Let me know if you have any further questions,

    Thanks,
    Charlie Maxwell
    [NM_Developer]

    Thread Starter SYPOMark

    (@sypomark)

    Hi Charlie,

    Thanks very much for your detailed reply.

    I have implemented what you suggested and it works perfectly.

    One additional tweak: the form fields are now displayed in order of Email, Name(title renamed), Rating, Review Content. What would be the best way to re-order these? Would editing the relevant file in the rich-review plugin folder be the best option? It’s not essential and my customer has yet to ask for it, but in case they do…

    With kind regards,

    Mark

    Plugin Contributor Nuanced Media

    (@nuanced-media)

    Mark,

    So conveniently the form fields are output in a much more itemized way, so they are pretty easy to work with. To get the effect that you want, you will want to edit rich-reviews.php where the form filters are set in the function starting on line 191 set_form_filters (pictured here: https://puu.sh/ofJ6k/2a05a7c9d0.png). The third parameter in each add action call is the priority, so each action for rr_do_form_fields sets a form field to either display or not, in it’s standard prioriy, which as you can see descends name, email, title, rating, content. So in order to switch title and email, simply switch the priorities (like so: https://puu.sh/ofKeV/d1be40d881.png). And that’ll do the trick.

    Let me know if you have any trouble.

    Thanks,
    Charlie Maxwell
    [NM_Developer]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Altering the order of elements in displayed reviews’ is closed to new replies.