Hey guys, i am trying to do something really simple:
I have a collection of posts called "blog" and i want to put out 10 posts at the same time and then show a pagination and let the user paginate over the blog posts.
The normal pagination is working but it puts out ALL pagination links. So if i have 11 pages it puts out all 11 pages. But i just want the first three pages and then have a ... link.
This is the code for the collection i am using:
{{ collection from="blog" slide="true" limit="2" paginate="true" as="posts" }} {{ posts }} // outputs post html {{ /posts }}
{{ paginate }}
<ul class="pagination">
{{ if prev_page }}
<li><a href="{{ prev_page }}#magazin-articles">«</a></li>
{{ /if }}
{{ links:segments }}
{{ first }}
{{ if page == current_page }}
<li class="active"><a>{{ page }}</a></li>
{{ else }}
<li><a href="{{ url }}#magazin-articles">{{ page }}</a></li>
{{ /if }}
{{ /first }}
{{ slider | dump }}
{{ if slider }}
<li class="disabled"><span>...</span></li>
{{ /if }}
{{ slider }}
{{ if page == current_page }}
<li class="active"><span>{{ page }}</span></li>
{{ else }}
<li><a href="{{ url }}#magazin-articles">{{ page }}</a></li>
{{ /if }}
{{ /slider }}
{{ if slider || (!slider && last) }}
<li class="disabled"><span>...</span></li>
{{ /if }}
{{ last }}
{{ if page == current_page }}
<li class="active">{{ page }}</li>
{{ else }}
<li><a href="{{ url }}#magazin-articles">{{ page }}</a></li>
{{ /if }}
{{ /last }}
{{ /links:segments }}
{{ if next_page }}
<li><a href="{{ next_page }}#magazin-articles">»</a></li>
{{ else }}
<li class="disabled"><span>»</span></li>
{{ /if }}
</ul>
{{ /paginate }}
{{ /collection }}
What can i do to activate the slider variable? The example is copied from the docs.
Any help is really appreciated!