I cannot paginate from the homepage

Hello!
I am new to Kirby and really like it so far. Only trouble I have had is that pagination does not work from the root URL.
When I have my news/blog page on:
rooturl.com/news
then pagination works and produces the URLs:
rooturl.com/news/page:2
etc.

When the news blog is the home page, which my client wants, the pagination URL is like this:
rooturl.com/page:2
which just redirects to:
rooturl.com/

Any tips?
Help appreciated!

Which Kirby version are you using? Are the articles children of the home page or have you used the c::set('home', 'somepage') option? Do you use any routes?

Hello!
I am not using any routes and I am not setting c::set(ā€˜home’, ā€˜somepage’).
The homepage in the folder 1-home.
The homepage is of template ā€˜news’ which has a controller called ā€˜news’.
Everything works fine when I change the page folder to ā€˜2-news’ so that it is not the homepage and has the URL rooturl.com/news.
I am using the latest Kirby version and have multilanguage enabled:
c::set(ā€˜language.detect’, true);
c::set(ā€˜languages’, array(
array(
ā€˜code’ => ā€˜en’,
ā€˜name’ => ā€˜English’,
ā€˜default’ => true,
ā€˜locale’ => ā€˜en_US’,
ā€˜url’ => ā€˜/’,
),
array(
ā€˜code’ => ā€˜fr’,
ā€˜name’ => ā€˜FranƧais’,
ā€˜locale’ => ā€˜fr_FR’,
ā€˜url’ => ā€˜/fr’,
),
array(
ā€˜code’ => ā€˜de’,
ā€˜name’ => ā€˜Deutsch’,
ā€˜locale’ => ā€˜de_DE’,
ā€˜url’ => ā€˜/de’,
),
array(
ā€˜code’ => ā€˜es’,
ā€˜name’ => ā€˜EspaƱol’,
ā€˜locale’ => ā€˜es_ES’,
ā€˜url’ => ā€˜/es’,
),
));

Though I am not using more than one language file, they are all en.txt.

Thanks for the help!

Looks like this happens when language.detect is enabled, this is definitely a bug.

I have created an issue on GitHub.

Thanks for your feedback!
I am using kirby-shopkit which requires multilanguage but I did notice that the url baseurl.com/news/page:2 does work so I can interpolate /new into the next page URL in the meantime.

:slight_smile:

If you only use one language, you can remove or comment out this line:

c::set('language.detect', true);

This bug is now fixed on the develop branch for the next release (2.4.1). You can already test if if you want. :slight_smile:

1 Like