Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-07-29 14:08:52

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Pagination Help

When i’m on a page of articles that is NOT the first page (ie ?pg=2), I would like to show a link to the main page.

So, if I’m on the home page, i don’t see the link to the home page, but if I’m on page 2 or 3 of articles, i want the link to show up.

i’m sure i’m missing something silly that can be done conditionally. ideas?

Offline

#2 2014-07-29 16:00:16

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 229
Website

Re: Pagination Help

I’ve found wet_if_page to be extremely handy in those situations. ;-) It’s very old plugin, but works. Something like this could do the job:

<txp:wet_if_page page="1"><txp:else />Not in front page.</txp:wet_if_page>

Offline

#3 2014-07-29 18:35:18

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: Pagination Help

thanks. that will do it!

Offline

#4 2014-08-12 15:04:10

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: Pagination Help

Hi,
A Txp native solution could be:

<txp:variable name="previous_page" value='<txp:newer />' />

<txp:if_variable name="previous_page" value="">

  There isn't any page before; don't do anything!

<txp:else />

   There is a page before the current page; display the pagination link!

</txp:if_variable>

Last edited by NicolasGraph (2014-08-12 15:11:56)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB