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.

Pagination with query

June 28, 2007 4:05am

Subscribe [2]
  • #1 / Jun 28, 2007 4:05am

    Adam George

    283 posts

    I’m trying to paginate the following, but keep getting the same page returned with the same data.
    Can I use pagination in this way?

    {exp:weblog:entries weblog="statenews" rdf="off" cache="yes" refresh="30" limit="3" paginate="bottom" orderby="date" sort="asc" show_future_entries="yes" sql1="(" statenews_advocacy="Climate change OR Refugees OR Micah Challenge" sql2=")" disable="member_data|trackbacks|categories"}
    {if no_results}
    Sorry, no advocacy news at this time.
    {/if}
    <div class="post">
        <h2>{title}</h2>
    <p>    <br />
            Campaign: <strong>{statenews_advocacy}</strong><br />
        <br />
        <div class="date">{entry_date format="%d %M %Y"}</div><br />
        {statenews_body}<br />
        {if statenews_extended}<br />
        <br />
            <a href="http://{url_title_path=advocacy/article}" class="pointer">Read more.</a><br />
        <br />
        {/if}<br />
        {paginate}<br />
        {if previous_page}<br />
        <a href="http://{auto_path}">Previous Page</a>  <br />
        {/if}<br />
        {if next_page}<br />
        <a href="http://{auto_path}">Next Page</a><br />
        {/if}<br />
        {/paginate}<br />
    </div><br />
    {/exp:weblog:entries}

  • #2 / Jun 28, 2007 10:23am

    Robin Sowell

    13255 posts

    The pagination looks fine to me- but what’s going on with the parameters- particularly:

    sql1="(" statenews_advocacy="Climate change OR Refugees OR Micah Challenge" sql2=")"

    And is it possible to link to an example page?

  • #3 / Jun 28, 2007 11:47am

    Adam George

    283 posts

    Hi Robin

    It’s using Marks’ custom fields in weblog:entries tag. For an example of the parameter: http://ellislab.com/forums/viewthread/38371/P36/#200716

  • #4 / Jun 28, 2007 11:51am

    Robin Sowell

    13255 posts

    Ah- I’m not sure if that’s a factor or not.  If you remove it- does it make any difference?  And can you link to an example of it failing to paginate?  (And next step will be to do some reduction testing- see if a simple example on an empty template works- and if not, turn on queries and figure out what’s happening there.)

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

ExpressionEngine News!

#eecms, #events, #releases