Problem/Motivation

Currently there's the views content "View row" to output a defined number of rows from a views context.
This is very handy if you've to limit the output to a specific number of rows independent from the pager.
What currently is missing is the possibility to display all the rows without any other views element - and have the number of rows defined by the pager.

Proposed resolution

Extend the current views content "View row" to allow to output all rows of a views context.
The attached patch does that manly by adding some conditions in the code and a new form field to manage the setting.
New behaviour:
If no rows are specified for output, all rows will be used.
This should be compatible with the earlier versions of this plugin.

Remaining tasks

Review attached patch.

User interface changes

New checkbox "Limit rows" on plugin settings form.
New text "Show all" all in admin title.

API changes

none.

Comments

das-peter’s picture

Fix for the case that there are no rows to display.

das-peter’s picture

*grml* Next fix.
Very ugly thing that row_index modification.
Would it be better to change the way how the row setting is stored?
But this would break backward compatibility...

merlinofchaos’s picture

Status: Needs review » Needs work

Rather than using a row index modifier, we should take $conf['rows'] and copy it into an array of rows to display. We can then modify the index there so we don't have to remember this later.

Something like this (pseudo code, don't cut & paste)

  if (empty($conf['rows']) {
    $row_indexes = array_keys($rows);
  }
  else {
    $row_indexes = array();
    foreach ($conf['rows'] as $index) {
      $row_indexes = $index - 1;
    }
  }

Then proceed normally knowing that $row_indexes will be correct.

das-peter’s picture

Status: Needs work » Needs review
StatusFileSize
new5.2 KB

Thank you very much for the review & this is indeed a nice idea!
Pseudo code cut & pasted - but also adjusted ;)

das-peter’s picture

Just came across a possible issue - updated patch.

merlinofchaos’s picture

Status: Needs review » Fixed

That's a much nicer patch!

Committed and pushed!

das-peter’s picture

Just awesome - thank you very much!

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