Jump to content

Developer Documentation

Reviews

  1. Overview of reviews

    Reviews are almost identical to comments; they behave in the same way and all of the options available to comments are available to reviews too. There's a few key differences: When submitting a review, in addition to the usual text body, members will provide rating out of 5 (or 10 if the site is configured so) Other members will be able to indicate whether they found the review useful or not, and this count is shown below the review. Members will only be able to submit one re
  2. Implementing the reviews model

    How to implement reviews Instead of extending \IPS\Content\Comment, your model should extend \IPS\Content\Review (which itself extends \IPS\Content\Comment but adds additional functionality specific to reviews). class _YourClass extends \IPS\Content\Reviews { //... } There are a number of additional keys you need to add to your model's $databaseColumnMap. Each value should be the database column name in your table that holds the value for each property. rating Required. The ra
  3. Displaying reviews in your application

    As with comments, how you display reviews in your application is up to you. However, there are some attributes that your markup should contain in order for dynamic functionality to work correctly. Here's a skeleton you can use as a starting point. <div data-controller='core.front.core.commentFeed' data-feedID='file-{$item->id}-reviews'> {{if $item->canReview()}} <h2 class='ipsType_sectionTitle'>{lang="write_a_review"}</h2> <br> {{endif}} <div class="ip
×
×
  • Create New...