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 not showing up in query tag

August 31, 2011 2:28pm

Subscribe [1]
  • #1 / Aug 31, 2011 2:28pm

    The Gateway

    11 posts

    So, in order to get around the fact that I cannot do pagination on reverse relations, I decided to use the query module to get the relevant information directly from the database. However, despite trying multiple ways of implementing it, I cannot get the pagination working at all.

    {exp:channel:entries}
    
    // some other things here
    
    {exp:query limit="1" paginate="bottom" sql='SELECT DISTINCT t.title,t.entry_id,t.channel_id,t.year,t.day,t.month,t.entry_date,c.cat_name,c.cat_id FROM exp_channel_titles as t,exp_channel_data as d,exp_relationships as r,exp_category_posts as cp,exp_categories as c WHERE r.rel_child_id = 11 AND r.rel_parent_id = d.entry_id AND t.entry_id = d.entry_id AND t.status="open" AND t.entry_id=cp.entry_id AND cp.cat_id=c.cat_id AND c.parent_id=0 ORDER BY t.entry_date DESC;'}
    
    <a href="http://my.domain.ca/index.php/article/view/{entry_id}">{title}</a>{cat_name}{entry_date format="%m/%d/%Y"}
    
    
    {paginate}
    
    Page {current_page} of {total_pages} pages {pagination_links}
    
    {/paginate}
    {/exp:query}
    {/exp:channel:entries}

    I have a suspicion that this may be from nesting the query tag inside of the entries tag, but I’m not sure. Ideas?

  • #2 / Sep 01, 2011 12:37am

    Dan Decker

    7338 posts

    The Gateway,

    That’s a pretty solid suspicion. Can you explain to me what it is you are trying to acomplish with {exp:query} and perhaps we can work out a simpler solution using just {exp:channel:entries}

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases