Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-05 13:43:44

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Show Page Number

How do I show the page number, so for example if I was at http://domain.com/articles/?pg=2 and I wanted to have a title on the page like <h2>Page 2</h2> How would I generate that? I can’t find any tag in the Textbook, so I take it I would need to use some PHP? Thanks


~ Cameron

Offline

#2 2009-06-05 13:51:15

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Show Page Number


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2009-06-05 14:26:15

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Show Page Number

maniqui wrote:

<txp:page_url />

Is their an if statement to work with this, so you can check if their is page number before showing it? so for example if your on page 1 then showing nothing but if you are then show the page number. otherwise you would end up with empty <h2></h2> tags.


~ Cameron

Offline

#4 2009-06-05 15:20:37

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

Offline

#5 2009-06-05 19:47:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,731
Website

Re: Show Page Number

Not sure where page_url comes into this. You want something like adi_gps to detect if there’s a pg GET variable and if present puts the value in a txp:variable which you can then use on your page.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2009-06-05 20:03:54

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

Re: Show Page Number

jakob wrote:

Not sure where page_url comes into this.

page_url’s job is to return parts of pretext, so it can also return the page number.

<txp:page_url type="pg" />

Last edited by Gocom (2009-06-05 20:06:40)

Offline

Board footer

Powered by FluxBB