Pagination function
  • Vote Up0Vote Down johnjohn
    Posts: 7Member
    Hi Guys,

    my problem regarding the search with Greek is fixed thanks Holman for the help.

    i am trying to build simple next, previous functionality,

    i am retrieving articles from sections with ID lower 33,

    i search all tpl files and i locate a file search-result.tpl,

    i copy paste the code from inside pagination.tpl,
    but no results,


    when i press next all the layout of the page is gone,
    http://localhost/EL/3/?tpl=1940
    after the button
    http://localhost/EL/?ls-art0=10

    how can i go to page 2?
    or go back?

    thanks for the help guys.


    {{ list_articles ignore_issue=true constraints="section smaller 33" order="bypublishdate desc" length="10" }}
    <li><a href="{{ uri options="article template article.tpl" }}">{{ $campsite->article->name }}({{ $campsite->article->publish_date|camp_date_format:'%h:%i' }}) </a></li>

    {{ local }}
    {{ unset_publication }}
    {{ unset_issue }}
    {{ unset_section }}
    {{ unset_article }}

    <div id="pagination">
    <ul>{{ $campsite->current_list->has_previous_elements }}
    {{ if $campsite->current_list->at_end && $campsite->current_list->count > $campsite->current_list->length }}

    {{ if $campsite->current_list->has_previous_elements }}
    <li><a href="{{ uri options="previous_items" }}">Previous {{ $campsite->current_list->count }}</a></li>
    {{ else }}
    <li>Previous</li>
    {{ /if }}

    {{ if $campsite->current_list->has_next_elements }}
    <li><a href="{{ uri options="next_items" }}">Next {{ $campsite->current_list->count }}</a>{{ $campsite->current_list->has_next_elements }}</li>
    {{ else }}
    <li>Next</li>
    {{ /if }}

    {{ /if }}

    {{ /local }}
    </ul>
    </div>


    {{ /list_articles }}
  • 1 Comment sorted by
  • Vote Up0Vote Down Mugur RusMugur Rus
    Posts: 132Member
    Hi John,

    Could you please send me the templates?

    Mugur

    On Thu, Apr 29, 2010 at 8:35 PM, john <
    campsite-support@lists.sourcefabric.org> wrote:

    > Hi Guys,
    >
    > my problem regarding the search with Greek is fixed thanks Holman for the
    > help.
    >
    > i am trying to build simple next, previous functionality,
    >
    > i am retrieving articles from sections with ID lower 33,
    >
    > i search all tpl files and i locate a file search-result.tpl,
    >
    > i copy paste the code from inside pagination.tpl,
    > but no results,
    >
    >
    > when i press next all the layout of the page is gone,
    > http://localhost/EL/3/?tpl=1940
    > after the button
    > http://localhost/EL/?ls-art0=10
    >
    > how can i go to page 2?
    > or go back?
    >
    > thanks for the help guys.
    >
    >
    > {{ list_articles ignore_issue=true constraints="section smaller 33"
    > order="bypublishdate desc" length="10" }}
    > <li><a href="{{ uri options="article template article.tpl" }}">{{
    > $campsite->article->name }}({{
    > $campsite->article->publish_date|camp_date_format:'%h:%i' }}) </a></li>
    >
    > {{ local }}
    > {{ unset_publication }}
    > {{ unset_issue }}
    > {{ unset_section }}
    > {{ unset_article }}
    >
    > <div id="pagination">
    > <ul>{{ $campsite->current_list->has_previous_elements }}
    > {{ if $campsite->current_list->at_end && $campsite->current_list->count >
    > $campsite->current_list->length }}
    >
    > {{ if $campsite->current_list->has_previous_elements }}
    > <li><a href="{{ uri options="previous_items" }}">Previous {{
    > $campsite->current_list->count }}</a></li>
    > {{ else }}
    > <li>Previous</li>
    > {{ /if }}
    >
    > {{ if $campsite->current_list->has_next_elements }}
    > <li><a href="{{ uri options="next_items" }}">Next {{
    > $campsite->current_list->count }}</a>{{
    > $campsite->current_list->has_next_elements }}</li>
    > {{ else }}
    > <li>Next</li>
    > {{ /if }}
    >
    > {{ /if }}
    >
    > {{ /local }}
    > </ul>
    > </div>
    >
    >
    > {{ /list_articles }}
    >
    >