Needed delimiter for the total count inserts, not just per page

Created on 20 December 2023, 11 months ago

Problem/Motivation

Module works perfectly considering we want to insert content in a per page view context. However, using an AJAX view and loading different pages once the user clicks the pager, I've noticed if you want to limit the results based on the total insertions in the total results views, there's not an implemented behavior for that.

Steps to reproduce

Create an Ajax View with N items (10 per example) and add a pager (5 items per page, with option to load the next pages, i.e Infinite Scroll). Configure the Views Row Insert settings to show a block or content in the nth-child = 4.
If you only want one content (inserted row) in total in the overall results, you can't achieve this, because it will insert a total of 2 new rows, first in 4nth child (as fifth row) and when pager loads the next page in 8th row (as 9th row).

Proposed resolution

I've extended the module functionality adding a new option where you can set the total limitation comparing the insertions vs "total results" context not just per page. If this option is not set, the module will work as designed, if it's set, then the module will limit the total insertions to this new field value.

Remaining tasks

Consider testing the patch or adding it to the next version if you consider this is a good feature to be integrated. Any improvements are welcomed.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain empesan

Live updates comments and jobs are added and updated live.
  • Needs testing review

    It is used to alert the testing topic maintainer(s) that an issue significantly affects (or has the potential to affect) testing, and their signoff is needed. See the governance policy draft and Drupal core gates - testing for more information.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024