Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have setup a sort criteria with Global: PHP, with this in the "Sort code:" field:
return ($row1->count_1 + $row1->count) < ($row2->count_1 + $row2->count) ? -1 : (int)($row1->count_1 + $row1->count) < ($row2->count_1 + $row2->count);
It works beautifully (adding up two fields of integers), but the result is not limited by the "Items to display", which is set to 8, but the view outputs all nodes. I should mention, I use a few relationships to determine the flag_count of a node.
Is there something I should do to limit the number of results?
My exported view code here: http://pastebin.com/AgyEhXKN
Comments
Comment #1
jerrylee-1 CreditAttribution: jerrylee-1 commentedI know, it's too late ;) But for those who are still dealing with this problem:
I have used the theming - in my view theme (table), I have put a if statement when rendering the table rows, in your case if it's less than 8, render the row...
This way works for me.
But I would definitely love, if this bug was fixed.
Comment #2
Liam MorlandDrupal 6 is no longer supported. If this applies to a later version, please re-open and update the version.