Next and previous pages: reversed meaning?

I’m puzzled with four .Page variables, .Next, .NextInSection, .Prev, .PrevInSection.
They seem to be named opposite to what they do. If, for instance, I’ve got pages in section weighted explicitly with 100, 200, 300, etc., then .NextInSection on page with weight 200 points to page weighted 100, and .PrevInSection to 300!

I thought at first it’s an error in documentation, that says:

Calling .NextInSection from the first page returns nil .

Can someone explain it? Is it a bug?

It’s just a confusing thing to name. Most of the time “previous” means “yesterday” for say, blog listings. Previous posts are from the past. Opposite previous is “next”. That’s all.

Another way to read it is the “next” page of results, and then opposing that is previous.

One meaning has to be chosen, and the existing one was. Hope that helps! :slight_smile:

According to default sorting order, items are sorted by weight in ascending order: 1, 2, 3, … That makes ‘1’ previous to ‘2’, and ‘3’ next.

No, when I look at the first page, the second page is previous. And the third previous before that.

“Previous” and “next” refer to the order of the pages, in the standard reverse chronological order sense, regardless of actual order of content. It derives from how people think of archives.

The ‘reverse chronological order sense’ just reverses the meaning of two common English words, IMHO. Well, if it is the conscious design decision, I can live with it. However, I would advise to make it more clear in the documentation.

Please edit the page in question and submit a patch. :slight_smile: