Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-02-28 17:34:13

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

article list paging

I’m limiting the number of article’s displayed in an article list because of space.
What is the most efficient way to page through other articles in a section by the same number as the article list is limited to? I mean if i have limit=“5” and I want to display the next 5 starting on article 6 what is the best way. I’ve been fooling with offset and pageby but don’t really understand how they work or if that is the best solution.
Thanks.


its a bad hen that wont scratch itself.
photogallery

Offline

#2 2011-02-28 18:22:53

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: article list paging

limit="5" is all you need; offset and pageby are automatic for normal pagination.


Code is topiary

Offline

#3 2011-02-28 18:24:51

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

oh ok. What tags would you use to load the next 5 articles then? thanks.


its a bad hen that wont scratch itself.
photogallery

Offline

#4 2011-02-28 18:47:48

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,256
Website GitHub Mastodon Twitter

Re: article list paging

kvnmcwebn wrote:

oh ok. What tags would you use to load the next 5 articles then? thanks.

from the default install:)

<txp:older>&#171; <txp:text item="older" /></txp:older> <txp:newer><txp:text item="newer" /> &#187;</txp:newer>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2011-02-28 19:02:32

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

hi colak,
thats the first thing i tried before i posted this thread. Nothing shows up even though there are older articles.

here’s my code and the code you provided, still no links appear:

<txp:article_custom section="signs_gal" wraptag="ul" break="li" class="thumbs"   limit="5"   >
    <txp:permlink><txp:article_image thumbnail="1" /></txp:permlink>
</txp:article_custom>
<txp:older>« <txp:text item="older" /></txp:older> <txp:newer><txp:text item="newer" /> »</txp:newer>

its a bad hen that wont scratch itself.
photogallery

Offline

#6 2011-02-28 19:35:47

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article list paging

Pagination doesn’t work with article_custom. From Textbook:

Unlike the article tag, article_custom will always return an article list and is not context-sensitive. This means while the article tag can only see posts within the currently viewed section/category/author and so forth, article_custom can see all posts from all sections, categories and authors unless you restrict it via attributes (see below), thus context-sensitive navigation tags, such as older and newer, will not work.

Last edited by els (2011-02-28 19:36:26)

Offline

#7 2011-02-28 19:44:16

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

ahh… thanks.


its a bad hen that wont scratch itself.
photogallery

Offline

#8 2011-02-28 20:21:54

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

I have another problem now. When I select one of the articles the list dissapears and only the link to the article that is active remains. Is there a way I can keep the list even when on an individual article?


its a bad hen that wont scratch itself.
photogallery

Offline

#9 2011-02-28 22:02:38

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article list paging

To display an article list on an individual article page, you need an article_custom tag as well as the article tag. But you won’t be able to paginate that list…

Last edited by els (2011-02-28 22:03:26)

Offline

#10 2011-03-01 13:15:41

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

Well thanks Els I will work with that as I’d like to keep the pagination. I’d like keep the older and newer links on the individual articles but that is not working for me now!


its a bad hen that wont scratch itself.
photogallery

Offline

#11 2011-03-01 21:44:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article list paging

Older and newer links work only in article list mode… that damn context sensitivity again ;)

Offline

#12 2011-03-01 21:59:16

kvnmcwebn
Member
From: Ireland
Registered: 2007-01-27
Posts: 724
Website

Re: article list paging

:)… I’m bad with the context sensitivity allright… Just figured it out using if_individual article in conjunction with older and previous etc…


its a bad hen that wont scratch itself.
photogallery

Offline

Board footer

Powered by FluxBB