Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Ok. Let's see if I can make this question as clear as possible:

I'm listing a lot of pages, so the pagination is necessary. I'm limiting the page to show 10 'posts' at a time, using the "previous" and "next" links below the list.

It's something around 150 pages, so the visitor surf trough these 'pages' (pagination breaks), and choose what he want to hear. Clicking on the link, it opens the audio player in the same tamplate (thanks to the cms:embed,) and he can access the contents of the 'post'.

However. If the user clicks on any link of the 3rd 'pagination break' (Ex.: mysite/play.php?pg=3) to load the audio player, when we look to the episodes area, it's showing the first page. It's understandable, since the link we get is (Ex.: mysite/play.php?p=62) notice that the pg (pagination) information is missing.

How can i 'fix' this 'pagination' so the user don't get lost on my huge page lists? Something like getting the link (Ex.: mysite/play.php?p=62&pg=3)?

Let me answer myself: (I can't believe I haven't figured something simple as this before. Couch simplifies in a way you will think 'That's too obvious to work' sometimes when coding your site.)

Here is how I was doing (the standard):

Code: Select all
<a href="<cms:show k_page_link />">
<cms:show k_page_title />
</a>


This is how you do it (well... at least it works!):

Code: Select all
<a href="<cms:show k_page_link />&pg=<cms:show k_current_page />">
<cms:show k_page_title />
</a>
Glad to hear you got this working. :)

You may want to use the add_querystring tag (docs/tags-reference/add_querystring.html). If you then decide to use pretty urls you won't encounter a missing question mark on the first page:
Code: Select all
<a href="<cms:add_querystring k_page_link "pg=<cms:show k_current_page />" />">
<cms:show k_page_title />
</a>
2 posts Page 1 of 1