- Issue created by @empesan
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.
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).
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.
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.
Needs review
2.0
Code
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.