Jump to content

Adequate Pagination for Paysite Theme 1


S_Flash
 Share

Recommended Posts

You can render any pagination you want.

 

There are multiple ways to define pagination and it is not correct to say that some is accurate and other is not accurate.

 

In pagination template you can use the following variables:

{{$nav.first}} - first page URL
{{$nav.last}} - last page URL
{{$nav.next}} - next page URL (empty on the last page)
{{$nav.previous}} - prev page URL (empty on the first page)
{{$nav.page_now}} - the number of current page
{{$nav.page_total}} - the total number of pages == the last page number

Link to comment
Share on other sites

  • 2 years later...

My Pagination looks like this: 

<div class="container">
    {{if $nav.show==1}}
        <div class="pagination">
            {{if $pagination_direct_link!=''}}
                <a class="btn btn--full-width" href="{{$pagination_direct_link}}">{{$lang.common_list.load_more}}</a>
            {{else}}
                <div class="pagination-holder">
                    <ul>
                        {{if $nav.is_first==1}}
                            <li><a class="disabled"><i class="icon-chevron-left"></i></a></li>
                        {{else}}
                            <li><a href="{{$pagination_url_prefix}}{{$nav.previous}}"><i class="icon-chevron-left"></i></a></li>
                        {{/if}}

                        {{section name=index start=0 step=1 loop=$nav.page_str}}
                            {{if $nav.page_str[index]!=''}}
                                <li><a href="{{$pagination_url_prefix}}{{$nav.page_str[index]}}">{{$nav.page_num[index]|intval}}</a></li>
                            {{else}}
                                <li class="active"><a class="disabled"><span>{{$nav.page_num[index]|intval}}</span></a></li>
                            {{/if}}
                        {{/section}}

                        {{if $nav.is_last==1}}
                            <li><a class="disabled"><i class="icon-chevron-right"></i></a></li>
                        {{else}}
                            <li><a href="{{$nav.next}}"><i class="icon-chevron-right"></i></a></li>


<li><a href="{{$nav.page_total}}/">Last</a></li>


                        {{/if}}
                    </ul>
                </div>
            {{/if}}
        </div>
    {{/if}}
</div>

 

 

 

For "<li><a href="{{$nav.page_total}}/">Last</a></li>" "Last" I would like it to show the final number, for example if I have 111 pages it should show something like
< 1 2 3 4 5 6 7 8 9 > 111

Or even more perforable would be:
< 1 2 3 4 5 6 7 8 9 ... 111 >

Edited by longsack
clicked enter to soon
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...