Pagination differing numbers of articles in different parts of your section?
  • Hello, first of all I want to thanks everybody. Second, I'm a journalist and really noob in Newscoop. I don't know well HTNL and CSS and I have no knowledge about PHP, smarty and programming logic.

    Well, I'm  customizing RockStar  Theme for our daily house organ, and it is almost done. And I realized that there is a problem tha I try to solve. I've have already read the Cookbook section about pagination (http://sourcefabric.booktype.pro/newscoop-44-cookbook/pagination-of-article-lists/), and there is the problem that I have to solve: have differing numbers of articles in different parts of your section article lists.

    1) The code for paginatios in Rockstar Theme is a little different. So, I don't realized how to set the index back. My first page list has 8 article and the other must have 9. How do that?

    There is the code I'm using for it:
    {{ list_articles length="9" ignore_issue="true" }}
    (...)
    { if $gimme->current_list->at_end }}
    {{* PAGINATION *}}
    {{ $pages=ceil($gimme->current_list->count/9) }}
    {{ $curpage=intval($gimme->url->get_parameter($gimme->current_list_id())) }}
    {{ if $pages gt 1 }}
    <div class="paging-holder">
    {{ if $gimme->current_list->has_previous_elements }}
    <a href="{{ uripath options="section" }}?{{ urlparameters options="previous_items" }}" class="prev"><span>< {{ #page# }} {{ #previous# }}</span></a>
    {{ /if }}
    <span class="paging">
    {{ for $i=0 to $pages - 1 }}
    {{ $curlistid=$i*9 }}       
    {{ $gimme->url->set_parameter($gimme->current_list_id(),$curlistid) }}
    <a {{ if $curlistid == $curpage }} class="active"{{ /if }} href="{{ uripath options="section" }}?{{ urlparameters }}">{{ $i+1 }}</a></li>
    {{ $remi=$i+1 }}
    {{ /for }}
    </span>
    {{ if $gimme->current_list->has_next_elements }}
    <a href="{{ uripath options="section" }}?{{ urlparameters options="next_items" }}"  class="next"><span>{{ #next# }} {{ #page# }} ></span></a>
    {{ /if }}
    </div><!-- / Pagination -->
    {{ $gimme->url->set_parameter($gimme->current_list_id(),$curpage) }}
    {{ /if }}
    {{ /if }}
    {{ /list_articles }}

    Sorry for that no notion question.