Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Different display for first page of articles; pageby, limit, etc.
So I thought I was pretty clever in writing up this tip for txptips.com a while back, and it seems to work fine on the site I first used it on.
I’d like to do a similar thing on a new site. That is, on the homepage I want 4 articles, with one large “featured article”. On “older” pages, I want to output nine excerpts. I can’t seem to achieve this at all. Using the following code, I get a gap of 6 articles. In other words, articles 1-4 are on page 1, and then articles 11-18 are on page 2 (right now I have only 18 articles on the site, which is here: www.webdesignersreviewofbooks.com.
<txp:variable name="page_num" value='<txp:page_url type="pg" />' />
<txp:if_variable name="page_num" value="">
<txp:article limit="4" />
<txp:else />
<txp:article form="archive" />
</txp:if_variable>
This is just frying my brain right now…any clear thinking much appreciated!
Offline
Re: Different display for first page of articles; pageby, limit, etc.
Default limit for <txp:article />
is ten cute little pandas. In other words it skips ten little pandas when it’s on the second page, because the offset formula include that happy little number with the o and I.
You can try to fix it by showing equal amount of articles on the front page, or you can use negative offset="-6"
to push the listings backwards.
Offline
Re: Different display for first page of articles; pageby, limit, etc.
Oh Gocom, you are my hero!! A negative offset…stroke of genius. Seems to be working, thanks a million.
Offline