ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Weblog entries pagination

March 30, 2010 7:35am

Subscribe [6]
  • #1 / Mar 30, 2010 7:35am

    dotnetster

    22 posts

    Hi,

    I can’t get pagination to work on my weblog entries.  The pagination links do not show.  See my code below.  Any ideas?

    <div class="boxfront1">
    {exp:weblog:entries weblog="news_articles" disable="trackbacks|comments|member_data" paginate="bottom" limit="1"}
    
        <h2 id="titlenews"><a href="http://{title_permalink=news_articles/view}">{title}</a></h2>
        {entry_date format="%F %d, %Y"}
    
    {article_excerpt}
    {/exp:weblog:entries}
    </div>
    
    
    {if paginate}
    <div>
        {page_count}   {paginate}
    </div>
    {/if}

    Thanks in advance

    Ross

  • #2 / Mar 30, 2010 9:44am

    Sue Crocker

    26054 posts

    Ross, is this a single entry template? In other words, are you passing a url_title or entry_id in the URL?

  • #3 / Mar 30, 2010 10:01am

    dotnetster

    22 posts

    Hi Sue,

    The url looks like: http://localhost:8888/mysite/index.php/news_articles/

    It is an index template in the “news_articles” template group displaying a list of news articles, so no entry ids are beings passed.

    Where would I specify how many entries to display per page?  I note that when using the search functionality, there is a “results” parameter, which I can set to restrict the number of entries per page.  However, the only parameter that comes close in the weblog entries tag is “limit”.  However, using “limit” will just limit the number of displayed entries (which is not what I want)

    Thanks

    Ross

  • #4 / Mar 30, 2010 10:02am

    dotnetster

    22 posts

    I note in my code above, that I have the limit parameter set to 1.  However, removing this does not make any difference.

  • #5 / Mar 30, 2010 10:29am

    Sue Crocker

    26054 posts

    You set the numbers per page using the limit parameter.

    But I spotted the problem. You need to have your pagination code *inside* the exp:weblog:entries tag.

  • #6 / Mar 30, 2010 4:22pm

    dotnetster

    22 posts

    Hi Sue,

    Thanks for getting back to me.  I tried that, but still no joy.

    Ross

  • #7 / Mar 30, 2010 4:30pm

    Ingmar

    29245 posts

    However, the only parameter that comes close in the weblog entries tag is “limit”.  However, using “limit” will just limit the number of displayed entries (which is not what I want)

    Yes, please try that:

    If you are using pagination then [the limit parameter] will determine the number of entries shown per page.

  • #8 / Apr 11, 2010 8:02pm

    Steve Garcia

    57 posts

    **moved to new thread***

  • #9 / Apr 11, 2010 8:20pm

    Mark Bowen

    12637 posts

    Try changing :

    {if paginate}

    to

    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}

    Also place the tags within the weblog tag. Might just be me but I don’t think there is such a thing as {if paginate} not for the weblog entries tag anyway. I also don’t think that {page_count} is valid for weblog entries either is it?

    You also have an {if paginate} followed by a {paginate} and then an end {/if}. Pretty sure this is all incorrect. Might want to take a look at the documentation for weblog entry pagination here.

    After saying all of this you’re not using an extension to control pagination perhaps are you and that’s why these variables all look wrong perhaps?

    Hope that helps a bit.

    Best wishes,

    Mark

  • #10 / Apr 12, 2010 1:53am

    John Henry Donovan

    12339 posts

    dotnetster, does Mark provide further insight here?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases