Textpattern Forum

You are not logged in. Register | Login | Help

#1 2005-11-04 03:47:28

zem
Developer emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579
Website

txp:article pageby attribute

The new (4.0.2) pageby attribute is designed to help split an <txp:article /> tag into several chunks, without messing up older/newer links. It tells <txp:article /> how many articles to jump forward or back when an older or newer link is clicked. Quick example:

<div id="first"><txp:article limit=1 pageby=10 /></div>
<div id="middle"><txp:article limit=8 offset=1 pageby=10 /></div>
<div id="last"><txp:article limit=1 offset=9 pageby=10 /></div>

Another:

<txp:article limit=5 pageby=10 />
<!-- google ad -->
<txp:article limit=5 offset=5 pageby=10 />

The pageby number should be the total number of articles displayed on the page. Without pageby, each article tag would page independently based on its own limit, as if it was the only article tag.

With a little imagination you can use this to break your main article list up into horizontal or vertical columns or chunks of any size, place ads or divisions anywhere you want, etc.


Alex
tstate

Offline

#2 2005-11-28 12:53:24

alesh
Member
From: Miami, FL
Registered: 2005-04-13
Posts: 147
Website

Re: txp:article pageby attribute

excellent; this needs to get into textbook.

The only thing to add is that the second <txp:article /> tag needs to be surrounded with <txp:if_article_list>. Bad things will happen on single-article pages elsewhise.


Yes, I have tried turning it off and on.

Offline

#3 2006-01-12 18:25:13

wet
Developer
From: Lenzing, Austria
Registered: 2005-06-06
Posts: 3,091
Website

Re: txp:article pageby attribute

This results in side effects in the context of search result listings.

Last edited by wet (2006-01-12 18:26:11)

Offline

Board footer

Powered by FluxBB