Discussions
Activity
Sign In
How it works
Newscoop Support
[decided]Comments Pagination
Vote Up
0
Vote Down
Andrei S.
February 2015
Posts: 117
Member
How to make comments pagination for articles?
Post edited by Andrei S. at 2015-02-19 01:56:20
2 Comments
sorted by
Votes
Date Added
Vote Up
0
Vote Down
Andrei S.
February 2015
Posts: 117
Member
{{list_article_comments length="5" order="bydate desc"}}
{{ if $gimme->current_list->at_beginning }}
<div class="row comment-box" id="comment-{{$gimme->current_list->index}}">
<div class="span1">
{{ if $gimme->comment->user->identifier }}
<a href="http://{{ $gimme->publication->site }}/user/profile/{{ $gimme->comment->user->uname|urlencode }}" class="avatar">
<img src="{{ include file='_tpl/user-image.tpl' user=$user width=60 height=60 }}" alt="{{ $gimme->comment->user->uname }}">
</a>
{{ else }}
<img src="{{ include file='_tpl/user-image.tpl' user=$user width=60 height=60 }}" alt="{{ $gimme->comment->user->uname }}">
{{ /if }}
</div>
<div class="span7 comment-content">
<h4 class="pull-left comment-author link-color">
{{ if $gimme->comment->user->identifier }}
<a href="http://{{ $gimme->publication->site }}/user/profile/{{ $gimme->comment->user->uname|urlencode }}">{{ $gimme->comment->user->uname }}</a>
{{ else }}
{{ $gimme->comment->nickname }} ({{ #anonymous# }})
{{ /if }}
</h4>
<div class="pull-right comment-date">
<time class="timeago" datetime="{{ $gimme->comment->submit_date }}">{{ $gimme->comment->submit_date }}</time>
</div>
<div class="clearfix"></div>
<div class="comment-body">
{{ $gimme->comment->content}}
</div>
</div>
</div>
{{ else }}
<div class="row comment-box" id="comment-{{$gimme->current_list->index}}">
<div class="span1">
{{ if $gimme->comment->user->identifier }}
<a href="http://{{ $gimme->publication->site }}/user/profile/{{ $gimme->comment->user->uname|urlencode }}" class="avatar">
<img src="{{ include file='_tpl/user-image.tpl' user=$user width=60 height=60 }}" alt="{{ $gimme->comment->user->uname }}">
</a>
{{ else }}
<img src="{{ include file='_tpl/user-image.tpl' user=$user width=60 height=60 }}" alt="{{ $gimme->comment->user->uname }}">
{{ /if }}
</div>
<div class="span7 comment-content">
<h4 class="pull-left comment-author link-color">
{{ if $gimme->comment->user->identifier }}
<a href="http://{{ $gimme->publication->site }}/user/profile/{{ $gimme->comment->user->uname|urlencode }}">{{ $gimme->comment->user->uname }}</a>
{{ else }}
{{ $gimme->comment->nickname }} ({{ #anonymous# }})
{{ /if }}
</h4>
<div class="pull-right comment-date">
<time class="timeago" datetime="{{ $gimme->comment->submit_date }}">{{ $gimme->comment->submit_date }}</time>
</div>
<div class="clearfix"></div>
<div class="comment-body">
{{ $gimme->comment->content}}
</div>
</div>
</div>
{{ /if }}
{{ if $gimme->current_list->at_end }}
{{* PAGINATION *}}
{{ $pages=ceil($gimme->current_list->count/5) }}
{{ $curpage=intval($gimme->url->get_parameter($gimme->current_list_id())) }}
{{ if $pages gt 1 }}
<nav class="span8">
<div class="pagination">
<ul>
{{ if $gimme->current_list->has_previous_elements }}<li class="prev"><a href="{{ uripath options="comment" }}?{{ urlparameters options="previous_items" }}">«</a></li>{{ /if }}
{{ for $i=0 to $pages - 1 }}
{{ $curlistid=$i*5 }}
{{ $gimme->url->set_parameter($gimme->current_list_id(),$curlistid) }}
{{ if $curlistid != $curpage }}
<li><a href="{{ uripath options="comment" }}?{{ urlparameters }}">{{ $i+1 }}</a></li>
{{ else }}
<li class="active disable"><a href="{{ uripath options="comment" }}?{{ urlparameters }}">{{ $i+1 }}</a></li>
{{ $remi=$i+1 }}
{{ /if }}
{{ /for }}
{{ if $gimme->current_list->has_next_elements }}<li class="next"><a href="{{ uripath options="comment" }}?{{ urlparameters options="next_items" }}">»</a></li>{{ /if }}
</ul>
</div>
</nav>
{{ $gimme->url->set_parameter($gimme->current_list_id(),$curpage) }}
{{ /if }}
{{ /if }}
{{/list_article_comments}}
Post edited by Andrei S. at 2015-02-19 01:50:42
Vote Up
0
Vote Down
Andrei S.
February 2015
Posts: 117
Member
del
Post edited by Andrei S. at 2015-02-19 01:50:53
Add a Comment
Start a New Discussion
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
8,397
Sourcefabric
↳
Announcements
25
Newscoop
↳
Newscoop Support
2,189
↳
Newscoop Development
722
↳
Newscoop Security
13
↳
Newscoop Documentation
17
↳
Newscoop Themes
69
Airtime
↳
Airtime Support
3,139
↳
Airtime Development
1,286
↳
Airtime Français
146
↳
Airtime Documentation
14
↳
Airtime Hacks
102
↳
Promote your station!
37
↳
Airtime Security
11
Booktype
↳
Booktype Support
277
↳
Booktype Development
55
↳
Booktype Documentation
7
Superdesk
↳
Superdesk Development
264
↳
Web Publisher
21
Poll
No poll attached to this discussion.
Top Posters
Albert FR
1978
Martin Konecny
1860
Andrey Podshivalov
1526
Voisses Tech
1423
John Chewter
899
Daniel James
844
Roger Wilco
784
hoerich
627
Paul Baranowski
389
Cliff Wang
339