Custom Templates

Here is a list of some custom templates you can do instead of using QARR built-in templates.

To use custom templates create a folder called qarr inside your templates directory.

Sample Templates

Look inside qarr/templates/frontend/custom for templates. So copy over what you need and configure.

File Extension

You can use html or twig extension

Display Rating

To display ratings you can use

{{ craft.qarr.displayRating(model) }}

Template

Checks templates/qarr/rating.twig directory first, then fallsback to qarr/frontend/custom/rating.twig.

Attributes

  • averageRating - Average rating number out of 5 stars.
  • total - Total number of approved reviews

Display Reviews

To display reviews you can use

{{ craft.qarr.displayReviews(model) }}

Template

Checks templates/qarr/reviews.twig directory first, then fallsback to qarr/frontend/custom/reviews.twig.

Attributes

  • reviews - Array of qarr\elements\Review elements
  • total - Total number of approved reviews

Replies

  • review.reply - Gets reply for review item
    • reply.author - Get author of reply
    • reply.dateCreated - Reply date

Display Questions

To display questions you can use

{{ craft.qarr.displayQuestions(model) }}

Template

Checks templates/qarr/questions.twig directory first, then fallsback to qarr/frontend/custom/questions.twig.

Attributes

  • questions - Array of qarr\elements\Question elements
  • total - Total number of approved questions

Answers

  • question.answers - Array of qarr\model\Answer models for specific question
    • answer - Returns answer string
    • anonymous - Checks if user requested to be posted anonymously
    • author - Gets author object craft\elements\User
    • abuse - Check is answer has been marked as abusive
    • dateCreated - Answer date