Our client wanted to be able to override the the number of items configured in the view.

I implemented this feature and share it with you. If you like the feature. please review it.

The patch is against the latest Viewfield 3.-dev version.

Note:
You need to run drush updb after applying the patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ayalon created an issue. See original summary.

ayalon’s picture

jerdavis’s picture

Status: Needs review » Needs work

This is an interesting idea. If there is more interest in this, let's please re-roll the patch and perhaps also include some further UX.

1) Make this optional enabled/disabled on the field settings
2) Possibly add a details set for advanced options to the field widget and place this option there?

kkri’s picture

Reroll against 8.x-3.0-alpha3.

jerdavis’s picture

This patch is not applying and does not contain any additional UX. Please provide an update and I'll review.

  • jerdavis committed 7c53f62 on 8.x-3.x
    Issue #3003839 by jerdavis, ayalon, kkri: Option to choose the number of...
jerdavis’s picture

Status: Needs work » Fixed

I manually applied the patch and made some updates to improve UX. Pushed in 7c53f62

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ecj’s picture

To have this work, you must have the pager set to:
> use Pager: Display a specified number of items | items

ecj’s picture

programmatically force the correct pager type from 'None' to 'Some':

in code somewhere around line 170

        //$view->pager = new \Drupal\views\Plugin\views\pager\None([], '', []);
          $view->pager = new \Drupal\views\Plugin\views\pager\Some([], '', []);
quotientix’s picture

Thanks @ecj - your comment helped me!