I've got two kinds of channel entries: Bills and Legislators. Legislators have a SuperTable of votes. Each vote is related to one Bill. I want to get all the votes associated with a particular Bill and display them on that Bill's page, but I can't fetch more than 100 items. Here's my current code:

{% set reverseRelatedVotes = craft.supertable.getRelatedElements({
    relatedTo: {
        targetElement: entry,
        field: 'scorecardVotes.bill',
    section: 'legislators'
}).limit(null).order('lastName ASC') %}

limit(10) works as expected, but anything over the standard Craft limit of 100 returns 100. How can I get all the related votes for a given Bill?


Figured it out - I needed to remove the limit earlier in the process: adding 'limit' => null after line 72 of SuperTableVariable.php did the trick.

I'll submit a pull request to that effect as soon as I figure out how to do that.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.