collectionsonline
collectionsonline copied to clipboard
Fix number of child records shown on MPH record
There is no longer a cap on MPH records fetched from ES, so on large records all children will be rendered. The problem with this is that this breaks the currently implemented show more button that is rendered after 23 results, as the children are no longer capped at that number, as seen on this record:
https://collection.sciencemuseumgroup.org.uk/objects/co8413731/collection-of-objects-and-archives-from-boddingtons-brewery-at-strangeways-collection-of-objects-and-archives
The cap was removed for another reason, but could be "re-implemented" lower down the hierarchy, after the results have been fetched, to create and render a slice of the records, that is rendered on the parent.
Show 'see more' button if count.direct-descendants
> child.length
In ES record:
"counts":
{
"direct-descendants": 101,
"all-descendants": 101
},
You may need to add counts
to fixtures/attributes.js