Jump to content

Developer Documentation

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="ipsClearfix">
		{{if $item->reviewPageCount() > 1}}
			<div class="ipsPos_left">
				{$item->reviewPagination( array( 'tab', 'sort' ) )|raw}
				<div class='ipsAreaBackground_light ipsPad'>
					{$item->reviewForm()|raw}
				</div>
			</div>
		{{endif}}
		<div class="ipsButtonBar ipsClearfix ipsResponsive_showDesktop ipsPos_right">
			<ul class="ipsButtonRow ipsPos_left ipsClearfix">
				<li data-action="tableFilter" data-filter="">
					<a href="{$item->url()->setQueryString( array( 'tab' => 'reviews', 'page' => 1, 'sort' => 'helpful' ) )}" class="{{if !isset( request.sort ) or request.sort != 'newest'}}ipsButtonRow_active{{endif}}" data-action="filterClick">{lang="most_helpful"}</a>
				</li>
				<li data-action="tableFilter" data-filter="members_filter_banned">
					<a href="{$item->url()->setQueryString( array( 'tab' => 'reviews', 'page' => 1, 'sort' => 'newest' ) )}" class="{{if isset( request.sort ) and request.sort == 'newest'}}ipsButtonRow_active{{endif}}" data-action="filterClick">{lang="newest"}</a>
				</li> 
			</ul>
		</div>
	</div>
	<br><br>
	<div data-role='commentFeed'>
		{{foreach $item->reviews() as $review}}
			{$review->html()|raw}
		{{endforeach}}
	</div>
</div> 

 


  Report Document


×
×
  • Create New...