Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2007-11-29 22:55:07
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: wet_if_page: Testing for listing page number
I was looking for a way to show 5 articles on page 1, and 20 articles on all subsequent pages (in two columns of 10). After a lot of puzzling how to set the offset attribute, I finally found that this code works:
<txp:wet_if_page>
<txp:article form="list_frontgroot" limit="5" />
<txp:else />
<div class="frontcol1">
<txp:article form="list_col" limit="10" pageby="20" offset="-15" />
</div>
<div class="frontcol2 clearfix">
<txp:article form="list_col" limit="10" pageby="20" offset="-5" />
</div>
</txp:wet_if_page>
<span class="left"><txp:newer>nieuwer</txp:newer></span>
<span class="right"><txp:older>ouder</txp:older></span>
I am happy, because it does what I want. But I’ve never heard of the use of a negative value for offset…
Just posting this in case someone might want to do the same thing :)
Offline
#14 2008-01-08 22:27:19
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: wet_if_page: Testing for listing page number
Wet, you might want to accept “last” and “first” in the page attribute. Here’s why
I didn’t know about this plugin back then.
Offline
Re: wet_if_page: Testing for listing page number
Another possible way to have some content on first page and not on another numbered page:
<txp:chh_if_data>
<txp:page_url type="pg" />
<txp:else />
<!-- put here what belongs only to the first page ->
</txp:chh_if_data>
Of course, you can do more things with wet_if_page. And the above request by guiguibonbon would be a nice add too.
Offline