Page 1 of 1

Page numbers in News

Posted: Tue Sep 28, 2010 5:39 pm
by palun
Hi,

Does anyone know how to get the paging function in the news module to show page numbers like this:

1 2 3 4 5 6 7 8 9

instead of arrows like this:

>>

This question has been asked before (http://forum.cmsmadesimple.org/index.ph ... 738.0.html), but there was no answer.

I found a solution to a similar problem here:
http://forum.cmsmadesimple.org/index.php?topic=10188.15
but the code is far beyond my knowledge of PHP.

If only I could get access to an array with links to the different news pages...

Grateful for any suggestions.

Cheers
/ulf

Re: Page numbers in News

Posted: Tue Sep 28, 2010 9:38 pm
by Peciura
It is easier than you think.

a. make sure you are using ugly url
b. create an UDT  ( i called it {pagination} at the very bottom of post)
c. post your summary template
d. write exact pagination string , e.g.
  >>

Re: Page numbers in News

Posted: Wed Sep 29, 2010 6:13 am
by palun
Hi Peciura
Thanks for your answer!

I am still not sure what to do though... I tried adding your pagination-udt to the bottom of my summary news template, but I don't know enough about the parameters...

Here's what I have / what I did:

-- I have a page with alias "newspage" in which the only content is this: {news number="3" lang="sv_SE" summarytemplate="newstmpl" category="General"}

(-- The template "newstmpl" is a slightly modified news summary "Sample" template - with the usual pagination.)

-- I created a UDT, {pagination}, from your code posted here: http://forum.cmsmadesimple.org/index.ph ... 88.15.html .

-- I added a call to the UDT to the bottom of template "newstmpl", but I don't know ho to set the parameters right. Could you help me out?

These are the parameters I don't understand:

'link' -- Is this the page alias? ("newspage" in my case)

'param' -- This is a "Unique part of url param". Could you explain further?

'assign' -- The variable I assign here would be an array of URLs to all news pages, is that correct? (If so, that would be great!)

'pattern' -- What should I put here? (I can ignore this and use the default, right?)

'extreme' -- (I don't need this, do I?)


If I knew more PHP I probably should be able to figure some of this out myself. Sorry for being such an idiot.

/ulf

PS. I'm using CMSMS 1.8.2 (with News 2.10.6) on XAMPP (localhost).

Re: Page numbers in News

Posted: Wed Sep 29, 2010 8:49 am
by Peciura
I have answered to your question on original thread http://forum.cmsmadesimple.org/index.ph ... #msg227790
I will edit that post if needed.

Re: Page numbers in News

Posted: Wed Sep 29, 2010 9:24 am
by palun
Thank you!
Much appreciated!
/ulf