Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-19 18:52:17

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Split into pages an article list

Hi, i have this problem: In my website I have a list of all my articles of a category arranged by date: like this:

if you can’t see the image, please, go there: http://img246.imageshack.us/img246/9168/a1ws3.gif

I used this code:

<txp:article_custom limit=99999 form="monthly_article" category="News" />
<div id="navigation">
 <txp:if_individual_article>
  <div class="al"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev></div>
  <div class="ar"><txp:link_to_next><txp:next_title /> »</txp:link_to_next></div>
 <txp:else />
  <div class="al"><txp:older>« <txp:text item="older" /></txp:older></div>
  <div class="ar"><txp:newer><txp:text item="newer" /> »</txp:newer></div>
 </txp:if_individual_article>     
</div>

And what, I need, as you can see, the page is too large, is to split the page, or divide it so I have the last 15 articles in one page, and the next 15 on other page, and so on.

Sorry for my bad English, I’m Spanish speaker, hope you can understand me.

Thanks in advance.

Regards,
Robhert.

Last edited by robhert (2008-02-19 21:46:43)

Offline

#2 2008-02-19 19:54:04

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Split into pages an article list

Because article_custom can’t be paginated by default, you could try out a plugin, chh_article_custom instead, as a replacement for article_custom.

<txp:cch_article limit="15" category="News" />
<div id="navigation">
	<txp:if_individual_article>
		<div class="al"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev></div>
		<div class="ar"><txp:link_to_next><txp:next_title /> »</txp:link_to_next></div>
	<txp:else />
		<div class="al"><txp:older>« <txp:text item="older" /></txp:older></div>
		<div class="ar"><txp:newer><txp:text item="newer" /> »</txp:newer></div>
	</txp:if_individual_article>     
</div>

Sorry for my bad English, I’m Spanish speaker, hope you can understand me.

Don’t worry, it’s not bad, not at all :)

Last edited by Gocom (2008-02-19 19:55:34)

Offline

#3 2008-02-19 21:52:05

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Re: Split into pages an article list

Hey! Gocom!, Thanks for your answer.

I’ve installed the chh plugin. And I have it working, and it’s fine, but I can’t figure out how to make ‘appear’ the links below like: “next 15 articles” or “older” links…

I have this:

<txp:chh_article_custom limit=10 listform="monthly_article" category="News" />
<div id="navigation">
 <txp:if_individual_article>
  <div class="al"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev></div>
  <div class="ar"><txp:link_to_next><txp:next_title /> »</txp:link_to_next></div>
 <txp:else />
  <div class="al"><txp:older>« <txp:text item="older" /></txp:older></div>
  <div class="ar"><txp:newer><txp:text item="newer" /> »</txp:newer></div>
 </txp:if_individual_article>     
</div>

Hope you can help me now too.

Regards.
Robhert.

Offline

#4 2008-02-19 23:10:13

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Split into pages an article list

If I’m not wrong, the tag should be <txp:chh_article /> instead of <txp:chh_article_custom />. Haven’t really never used chh_article_custom so much (read: never really), so it’s just thought.

Last edited by Gocom (2008-02-19 23:11:29)

Offline

#5 2008-02-20 00:44:54

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Re: Split into pages an article list

Thanks again for your answer. :D

I did it, I change it to just ‘article’ but nothing happends, in fact, I can’t see the article list. I see the article list only when I put <txp:article_custom or <txp:chh_article_custom>…

What should I do?… I don’t understand what I must to do.

Please, help, again.

Rob.

Offline

#6 2008-02-20 18:41:11

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

Re: Split into pages an article list

Hey, I did it! THANKS Gocom for you help!!!

I’ve done this: <txp:chh_article limit="10" listform="monthly_article" section="news" />

So I have now the links of pagination below.

Thanks :D

Offline

#7 2008-02-20 22:30:13

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Split into pages an article list

No problem Robhert :)

Offline

Board footer

Powered by FluxBB