[view:current-page]/[view:page-count] not rendered correctly

Created on 23 August 2024, 4 months ago
Updated 16 September 2024, 3 months ago

Problem/Motivation

In Views metatag [view:current-page]/[view:page-count] are always rendered as 1/1 whatever the page number is. Of what I understand it should be "current page number" and "total-page"s respectively. I tried it with mini pager, full pager and views infinite scroll, with and without "Use ajax" but nothing changes.

Steps to reproduce

- Create a view listing rendered teasers of several articles
- Paginate it so you have several pages (in my case 10 per page and some hundreds of pages)
- Set page title in metatags basic tags as "[view:title] [view:current-page]/[view:page-count] | [site:name] (I wanted to differentiate the page title to avoid duplicated content for seo purpose)

Also I don't see any default views settings in Metatags general settings but perhaps this is normal as of weak utility.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Views integration

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance erwangel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @erwangel
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    nilesh.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    3 months ago
    Total: 263s
    #284400
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    Please review the created MR.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance erwangel

    I applied the MR. [view:current-page] seems to be correct now. [view:page-count] gives inconsistent results.

    - On a view with a total of two pages, it gives (mini pager)
    It looks like there is a relation between the items/page setting and the displayed 'page-count'
    [items per page 16]
    first page 1/17 (1 + 16 ?)
    second page 2 /26 (16+9 ?)
    [items per page 10]
    1st page: 1/11 (1 + 10)
    2nd page: 2/21 (11+10)

    - On another view with a total of 4 pages, it displays (full pager)
    1st page: 1/2
    2nd page: 2/3
    3rd page: 3/4
    and so on

    - Same as previous with another view with 576 page (same behavior with full and mini pager)
    1/2, 2/3, 3/4, ..., 574/575, 575/576

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance erwangel

    Sorry, in the above 1st case it was my fault, I had [view:total-rows] instead of [view:page-count]. So the problem is that [view:page-count] displays [view:current-page] + 1 instead of the 'The total page count'.

    Other info that may be of interest: if I use Header > Global > Result summary tokens "@current_page -- the current page number" and "@page_count -- the total page count", they display correctly.

Production build 0.71.5 2024