EllisLab text mark
Advanced Search
     
Pagination inside embedded templates
Posted: 08 May 2009 05:48 AM   [ Ignore ]
Avatar
Joined: 2006-03-02
885 posts

Can you use pagination inside embedded templates? I’m getting {paginate} {/paginate} printed to the page when I use this set-up:

{exp:query sql="SELECT cat_id, cat_name FROM exp_categories WHERE cat_url_title = '{segment_3}'"}
{embed
="includes/content" section="{segment_1}" catID="{cat_id}"}
{
/exp:query} 

The embed

{exp:weblog:entries weblog="{embed:section}" category="{embed:catID}" limit="20" disable="member_data|pagination|trackbacks" dynamic="off" paginate="bottom"}
{if no_results}
<p>There are currently no items in this category.</p>{/if}
<div class="post">
  <
h2><a href="{path={segment_1}/item/{url_title}}">{title}</a></h2>
  
{summary}
</div>
{paginate}
{if 
"{total_pages}" != 1}<class="paginate">Page {current_page} of {total_pages} pages {pagination_links}</p>{/if}
{
/paginate}
{
/exp:weblog:entries} 
 Signature 

John Faulds — Owner Tyssen Design

 
Posted: 08 May 2009 06:52 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-22
1643 posts

*coughs*

disable="member_data|pagination|trackbacks" 
 Signature 

utilitEEs - Addons for EE

 
Posted: 08 May 2009 07:05 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-02
885 posts

Aw man!  red face  The number of times I’ve been caught up by the disable parameter.  rolleyes

Thanks!

 Signature 

John Faulds — Owner Tyssen Design

 
Posted: 24 June 2009 08:37 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts
silenz - 08 May 2009 10:52 AM

*coughs*

disable="member_data|pagination|trackbacks" 

That should be added or removed? I’m having the same problem.

 
Posted: 24 June 2009 08:40 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Take out the pagination disabling parameter part. That should fix it up for you right away.

You can either take out the whole disable=”“ parameter or just amend it so that it looks like this instead :

disable="member_data|trackbacks" 

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 24 June 2009 08:41 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-02
885 posts

Well if you’re trying to enable pagination, but have it as a disabled parameter, then it needs to be removed.

 Signature 

John Faulds — Owner Tyssen Design

 
Posted: 24 June 2009 09:01 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts

Thanks guys, I guess that isn’t my problem after all.

The pagination in my embedded templates works initially, but if I click one of the items in the embedded template and try to click again on the resulting page, it just goes in a loop and I end up with a url like ...  http://ee:8888/index.php/artists/view/adel_abdessemed/P2/P2/P2/P2/

it just keeps appending it to the end when really the URL should be http://ee:8888/index.php/artists/P2/

Hope you can help or advice an alternative way of doing this.

 
Posted: 24 June 2009 09:05 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

My guess would be that you have dynamic=“off” set in your weblog tag. Pagination won’t work without dynamic set to on otherwise it doesn’t know where it is in the scheme of things.

That would definitely be my first guess on this one.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 24 June 2009 09:10 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts

I tried that also, but if I do that the embedded template only shows the entry that I’m currently viewing and no pagination.

Basically I have a page that shows the first entry in the webblog and an embedded template on the right hand side that shoes all entries in the weblog but paginated.

I hope that makes sense.

 
Posted: 24 June 2009 10:30 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts

Is it possible to override the pagination links? or modify them?

 
Posted: 24 June 2009 11:30 AM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts

I managed to figure it out and found something in the documentation that I can use to over ride the pagination links…

I used the paginate_base= tag

http://expressionengine.com/docs/modules/weblog/parameters.html#par_paginate_base

Awesome.

 
Posted: 24 June 2009 11:51 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2007-04-16
37 posts

I thought I’d post a blog entry on this, I’ve not made myself all that clear on this thread lol.

http://www.newvibes.com/2009/06/24/expression-engine-paging-in-embedded-templates/